Multiplication with Single & Double datatype in Access 2003 give incorrect result

I have a simple Access table that has 3 columns ,the first is autonumber ,the second is of Number datatype and the Fieldsize is Sinlge ,the 3rd one is also Number and the FieldSize is Double ,the issue here when I create a query that mutliplies the 2nd and 3d coulmn (Single * Double) ,it will give incorrect results like if the 1st colume is 1100.55 and the second is 1.1 it would give inaccurate output ,i know there are issue arond floating points but what is the best solution to this delima ?
AJDeveloperAsked:
Who is Participating?
 
hnasrConnect With a Mentor Commented:
Tried LSMConsulting's comment?
What result did you get?
Try
CDbl(CCur([sngField])*CCur([dblField]))
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can try Formatting the output:

SELECT CCur((SingleField * DoubleFIeld)) As CalcField FROM SomeTable

Of course, which of the Convert functions you use would depend on what you're trying to achieve ... there are many of them available, and this one (CCur) convert to Currency.
0
 
AJDeveloperAuthor Commented:
Thanks but the output is not mathmatically correct ,i checked other function as well ,sinlg and double function ,is there a way to get a correct result
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
AJDeveloperAuthor Commented:
It worked ,but how ,what is the explaination ?
0
 
AJDeveloperAuthor Commented:
I still need to understand how the usage of the function in this way helped give out correct results
0
 
hnasrCommented:
This has to do with how computer stores variables in memory.
Check:
http://support.microsoft.com/kb/42980
0
 
AJDeveloperAuthor Commented:
Thanks guys for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.