Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 25th, 2007, 06:57 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Scaling of decimal value resulted in data truncati

getting subject error in one of the access query. any idea...

Thanks in advnce...

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
Reply With Quote
  #2 (permalink)  
Old May 25th, 2007, 10:31 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure what this means. Can you post the sql and what the data should look like, and what the data looks like when it is truncated?



mmcdonal
Reply With Quote
  #3 (permalink)  
Old May 28th, 2007, 04:14 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Thanks for the reply!!!
Query - "Select sum(lct)/sum(amt) from table1"
data should be in real number with 2 to 4 digit of decimal,
it dosen't shows any data it gives this error and terminates.

I guess it gives around 12 to 15 digit after decimal point and hence creates problem.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
Reply With Quote
  #4 (permalink)  
Old May 29th, 2007, 06:31 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Coud it be the missing parens? Did you create this in desinger, or did you write the SQL?

"Select sum(lct)/sum(amt) from table1"

Should be

"Select sum((lct)/sum(amt)) from table1"



mmcdonal
Reply With Quote
  #5 (permalink)  
Old May 29th, 2007, 06:54 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

i created it, but this seems working..

"Select CDbl(sum(lct)/sum(amt)) from table1 where prod = 'xx'"

but returns nothing if i remove product clouse and use group by as..

"Select CDbl(sum(lct)/sum(amt)) from table1 Group by prod" Any idea..?

Thanks again..

Rupen Anjaria.:)
------------------
It is not difficult to be on TOP...It is difficult when you carry Truth,Commitment and Transparency with you.
Reply With Quote
  #6 (permalink)  
Old May 29th, 2007, 06:59 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

How about:

SELECT table1.prod, CDbl(sum(lct)/sum(amt)) As Something
FROM table1
WHERE table1.prod = 'xx'



mmcdonal
Reply With Quote
  #7 (permalink)  
Old June 2nd, 2007, 08:31 AM
Authorized User
 
Join Date: May 2006
Location: , , India.
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque
Default

 
Quote:
quote:I guess it gives around 12 to 15 digit after decimal point and hence creates problem.
Quote:
Try using something like;

rst!AvgPurPrice = CDbl(Round(AvgPrice, 2))

If you use Sql Server as BE, I advice you to use float data type for the field.

Ashfaque

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
external-graphic scaling issue atulshin XSLT 3 October 21st, 2008 12:20 AM
Sprite Scaling cgibson BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 4th, 2007 06:58 PM
decimal data type all 0's after decimal gobotsoup SQL Server ASP 1 February 28th, 2007 02:32 PM
OWC10 Scaling Object rfrancisco Classic ASP Components 0 March 13th, 2006 02:44 PM
Getting decimal value snowydust VB How-To 1 October 18th, 2004 10:25 AM



All times are GMT -4. The time now is 06:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.