Round Down an Expression

J

jlp

Hello -
I have a query that has a calculated field as follows;

ItemsNeeded: Round([Forecast]/[CartonQty],0)

This is working to round off the result to an integer.
However, I need this to Round the result DOWN to to an
integer, not up if greater than .5 and down if less
than .5.

Essentially, I need the "Rounddown" function like in
Excel. Does this exist in Access?

Thank you in advance for your help!!
jen
 
P

Peter Hoyle

Try Int([Forecast]/[CartonQty],0)

Int just chops off anything after the decimal point,

Cheers,
Peter
 
B

Bruce M. Thompson

I have a query that has a calculated field as follows;
ItemsNeeded: Round([Forecast]/[CartonQty],0)

This is working to round off the result to an integer.
However, I need this to Round the result DOWN to to an
integer, not up if greater than .5 and down if less
than .5.

Essentially, I need the "Rounddown" function like in
Excel. Does this exist in Access?

See if this does what you need:

ItemsNeeded: [Forecast] \ [CartonQty]

Note that "\" forces integer division - it drops any fractional value.
 
J

jlp

Both of these methods worked. Thank you for the help!

-----Original Message-----
I have a query that has a calculated field as follows;

ItemsNeeded: Round([Forecast]/[CartonQty],0)

This is working to round off the result to an integer.
However, I need this to Round the result DOWN to to an
integer, not up if greater than .5 and down if less
than .5.

Essentially, I need the "Rounddown" function like in
Excel. Does this exist in Access?

See if this does what you need:

ItemsNeeded: [Forecast] \ [CartonQty]

Note that "\" forces integer division - it drops any fractional value.

--
Bruce M. Thompson, Microsoft Access MVP
(e-mail address removed) (See the Access FAQ at http://www.mvps.org/access)within the newsgroups so that all might benefit.<<


.
 

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