Floor and Ceiling functions

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

Guest

I wish to create an unbound control to show a person's age. However, I find
that Access doesn't have a floor (or ceiling) function (unlike Excel &
Foxpro).

Is there an alternative?

Kind regards

Tony
 
Not sure what you mean by a floor and ceiling function, or why you need it
here.

To calculate a person's age, the common method would be to place the
following in an unbound text box...


=DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(),"mmdd"))
 
Rick

Thanks for the quick response. I wouldn't have worked that out in a million
years.

I can best describe floor and ceiling functions as follows :

Floor(98.3) returns 98
Floor(98.9) returns 98
whereas
Ceiling(98.3) returns 99
Ceiling(98.9) returns 99
--
Kind regards

Tony


Rick B said:
Not sure what you mean by a floor and ceiling function, or why you need it
here.

To calculate a person's age, the common method would be to place the
following in an unbound text box...


=DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(),"mmdd"))

--
Rick B



NewKidontheBlock said:
I wish to create an unbound control to show a person's age. However, I find
that Access doesn't have a floor (or ceiling) function (unlike Excel &
Foxpro).

Is there an alternative?

Kind regards

Tony
 
Just for your info:
Access has an 'Int' function that works like a floor function (it returns the
integer portion of a number).

Int(34.8)=34
Int(34.2)=34
 
Doh!!

For some reason I thought the int() function rounded up and down to the
nearest integer.

Thanks for the reply.

Kind regards

Tony
 
Back
Top