Rounding off syntax

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

In a query I have the calculated field "Calc", with the number of decimals
set to "0" and the notation to "standard".
Now, when the calculation is 1,5 the fieldvalue is rounded off downwards
automatically to 1. Calculation 1,6 is rounded off upwards automatically to 2.

Can anyone show me a way to put the rounding off in the syntax of the
calculated field, so that if I want, for instance 1,9 is rounded off
downwards to 1 ?

Thank you in advance
 
In a query I have the calculated field "Calc", with the number of decimals
set to "0" and the notation to "standard".
Now, when the calculation is 1,5 the fieldvalue is rounded off downwards
automatically to 1. Calculation 1,6 is rounded off upwards automatically
to 2.

Can anyone show me a way to put the rounding off in the syntax of the
calculated field, so that if I want, for instance 1,9 is rounded off
downwards to 1 ?

Int([Calc])

Tom Lake
 
eric said:
In a query I have the calculated field "Calc", with the number of decimals
set to "0" and the notation to "standard".
Now, when the calculation is 1,5 the fieldvalue is rounded off downwards
automatically to 1. Calculation 1,6 is rounded off upwards automatically to 2.

Can anyone show me a way to put the rounding off in the syntax of the
calculated field, so that if I want, for instance 1,9 is rounded off
downwards to 1 ?


You need to use a calculation to get non-standard rounding.

With that said, you either mistake the value of 1.5 for
something less than that or you are already doing something
to round/truncate 1.5 to 1. Access's automatic rounding is
"Banker's Rounding" that rounds to the nearest even number
in the previous digit (e.g. 1.5 rounds to 2 and 2.5 rounds
to 2).

To want to truncate the entire fractional part of a number,
use either the Fix or Int functions, depending on how you
want to handle negative numbers.

Beyond that, you can Google the newsgroup archives to see
various specific or general rounding expressions.
 
Thank you Tom and Marshall for your quick response again, your help and advice.
You really help me a lot getting into Access. Thank you !!

Greetings
 

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