Ceiling and floor alternative

J

Jens Burup

Hi NG

I tryied to use Ceiling and Floor in ACCESS SQL , but it seem these
functions dosent work in ACCESS SQL
Any alternative?

Regards
Jens
 
M

Marshall Barton

Jens said:
I tryied to use Ceiling and Floor in ACCESS SQL , but it seem these
functions dosent work in ACCESS SQL


Depending on how you want to handle negative values, you can
use the Int or Fix functions for Floor.

An expression that is equivalent to Ceiling is:
IIf(var = Int(var), var, Int(var + 1))
or variations for negatinve values.
 
J

Jens Burup

Marshall Barton said:
Depending on how you want to handle negative values, you can
use the Int or Fix functions for Floor.

An expression that is equivalent to Ceiling is:
IIf(var = Int(var), var, Int(var + 1))
or variations for negatinve values.

I needed for a specific project the ceiling function to find the positive
value to the nearest 100, but digging a little bit more in this useful
group, I found the answer(YourNumber\100-(YourNumber MOD 100 <>0))*100
But i was also useful to know that such a statement does not exist in ACCESS
thx
Jens
 

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