Decimal Places Lost in Query Expression

G

Guest

When creating a query that divides two numbers, I loose the decimal places.
I get the whole number without any decimal numbers, just zeros.
Example: 100/11 = 9.09
My forumula returns 9.00
I have tried
1. Setting the properties for the query column and entering the fields
[Num1]/[Num2]
2. format(([Num1]/[Num2]),"Fixed")
3. format(([Num1]/[Num2]),"##0.00")
4. formatnumber(([Num1]/[Num2]),-1,-1)
I checked my regional settings and they are set to allow decimals.
It has to be a system/software issue.
Can anyone help?
 
G

Guest

I believe that this is likely happening because both of the numbers in the
expression are integers, so the result is being made to be an integer as well.

Try placing your field values inside the Cdbl() function, such as:

Cdbl(Num1)/Cdbl(Num2)

It is possible that it would work to use Cdbl(Num1/Num2), but I'm not sure
if Access would convert to integer before getting to the Cdbl() function.

HTH, Ted Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top