CEILING function doesn't work

A

Alex Brown

When I try to use this function in a query I get the
following message:

Undefined function 'ceiling' in expression.

Can anyone help?

Thanks,
Alex
 
J

John Spencer (MVP)

The Ceiling function is an EXCEL function and is not an Access function. You
can write a function to do this in VBA.

UNTESTED AIRCODE follows that should handle positive numbers. It may introduce
errors if the number passed in has less digits in the decimal portion than the
number of digits you wish to roundup to. For instance, fRoundup(.1,2) might
return .11


Public Function fRoundUp(dblNumber As Double, _
Optional intPlaces As Integer) As Double
fRoundUp = -Int(-dblNumber * 10 ^ intPlaces) / 10 ^ intPlaces
End Function
 

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