Clicky

Dear Experts,

I have an SQL 2005 table that contains two fields of datatype INT and one field of datatype REAL. They contain normal numbers. When I multiply all three and the REAL field contains a simple fracion, I get the results you see in the attached image*

Why is this??

Kind regards,
Keimpe

* screenshot is from an Access query in a database containing linked SQL tables. However, an SQL View gives the same results.
Weird.png (19 KB)
Weird multiplication results (image/png)

asked 04/01/2011 07:38

keimpe's gravatar image

keimpe ♦♦


3 Answers:
>REAL
that is the issue. REAL is an inaccurate data type. instead use decimal/number
link
angelIII's gravatar image

angelIII

The multiplication is correct. If you want you will have to round up the data to some decimals. as REAL is approximate data type even something like 1.2 may not really be that but also have some hidden fractions. So either you remove the use of REAL or ROUND or limit decimals of your multiplication output.
link
mohammad827's gravatar image

mohammad827

Thanks for your answers. I was never aware of this!
link
keimpe's gravatar image

keimpe

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×60
×17
×45

Asked: 04/01/2011 07:38

Seen: 201 times

Last updated: 04/02/2011 07:43