Floor and Ceiling functions

N

NewKidontheBlock

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
 
R

Rick B

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"))
 
N

NewKidontheBlock

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
 
G

guido via AccessMonster.com

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
 
N

NewKidontheBlock

Doh!!

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

Thanks for the reply.

Kind regards

Tony
 

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