Results of query has to many numbers behind decimal

  • Thread starter Thread starter jac007
  • Start date Start date
J

jac007

There is a table with 2 columns, one is a date field and the other a total
field. I ran a query to group by date and sum by total which works fine but
the result of the totals for each day gives me like 1324324.239084....
something like that, I would want the results to just be 1324324.23. I have
tried round and nothing happens. What can I do?
 
jac007 said:
There is a table with 2 columns, one is a date field and the other a total
field. I ran a query to group by date and sum by total which works fine but
the result of the totals for each day gives me like 1324324.239084....
something like that, I would want the results to just be 1324324.23. I have
tried round and nothing happens. What can I do?


That may be an artifact of using floating point numbers. In
many cases, the Currency data type can be used to avoid the
issue.

OTOH, the round function should work too. Since you didn't
post what you tried, I can't guess what might not have
worked.

Note 1: Sum(Round(x)) is not the same as Round(Sum(x))

Note 2: Since you should not display a query to users, it
is recommended that you do the rounding in a form/report by
using the text box's Format property.
 
There is a table with 2 columns, one is a date field and the other a total
field. I ran a query to group by date and sum by total which works fine but
the result of the totals for each day gives me like 1324324.239084....
something like that, I would want the results to just be 1324324.23. I have
tried round and nothing happens. What can I do?

What's the datatype of the field that you're summing? And what - in the real
world - is in this field?

My guess is that it's Number... Double and that what you're summing is money;
if so, I'd suggest changing the datatype of the table field from Number...
Double to Currency.

Failing that, I don't know why Round shouldn't work. Could you post the SQL of
the query?

John W. Vinson [MVP]
 

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

Back
Top