Home All Groups Group Topic Archive Search About

calculations sql server versus vb.net

Author
30 Jun 2005 11:06 PM
Rajesh
Hello Sql Gurus,

I had a calculation    999999999999.99 * (7.00 /100 / 12) * 6

sql server    gives        34999997999.99965000002   
vb.net    gives        34999999999.999649 (tried in debugger)

I had breakdown the problem to resolve as below.
could any of you throw some light to resolve this.


    Calculation

    7.00 / 100               
                sql server
                .070000           
                vb.net
                0.07


    7.00 / 100/ 12           
                sql server
                .005833333
                vb.net
                0.0058333333333333336

                     (7.00 /100 / 12) * 6           
                sql server
                .034999998
                vb.net   
                0.035

                     999999999999.99 * (7.00 /100 / 12)   
                sql server
                5833332999.99994166667   
                vb.net   
                5833333333.3332748

                   999999999999.99 * (7.00 /100 / 12) * 6    
                sql server
                34999997999.99965000002   
                vb.net   
                34999999999.999649

Thanks
Rajesh.

Author
1 Jul 2005 1:01 AM
Mike Labosh
> I had a calculation    999999999999.99 * (7.00 /100 / 12) * 6
>
> sql server gives 34999997999.99965000002
> vb.net gives 34999999999.999649 (tried in debugger)

Strange.  What were the data types that you used in SQL & VB?

--
Peace & happy computing,

Mike Labosh, MCSD

"Mr. McKittrick, after very careful consideration, I have
come to the conclusion that this new system SUCKS."
-- General Barringer, "War Games"

AddThis Social Bookmark Button