Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.
  #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
  #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.
  #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
  #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.
  #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
  #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



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





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