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

Posted on 2009-12-22
Last Modified: 2012-05-08
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 ?
Question by:AJDeveloper
    LVL 84
    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.

    Author Comment

    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
    LVL 30

    Accepted Solution

    Tried LSMConsulting's comment?
    What result did you get?

    Author Comment

    It worked ,but how ,what is the explaination ?

    Author Closing Comment

    I still need to understand how the usage of the function in this way helped give out correct results
    LVL 30

    Expert Comment

    This has to do with how computer stores variables in memory.

    Author Comment

    Thanks guys for the help

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now