Would someone please tell me how to round numbers in access? I am trying to round down, and have tried floor(num,0), floor(num,1), floor(num) and all sorts of variations but can't make anything work. Rounddown also doesn't work.
I am working on a report, but I need to tell peoples age in the report as follows:
datediff('m', expr1, now())/12
Therefore, I need to round these numbers down. I have checked the msowcf.dll and it is installed(i registered it at command line also)
Thank you very much in advance!
you are definately right.
now I'm thinking, to do that we could also do;
Public Function Floor(ANumber As Variant, Optional ADec As Variant= 0) As Variant
'Default Usage : Floor(NumberToFloor)
'Optional Usage: Floor(NumberToFloor, RoundingDecimal)
If IsNull(ANumber) Then Floor = Null: Exit Function
ADec = 10 ^ ADec
Floor = Int(ANumber / ADec) * ADec
I editted the code now it handles 1/10, 1/100, etc
Last edited by ghozy; 09-22-04 at 15:47.
Reason: code correction