Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date arithmetic

Status
Not open for further replies.

Alincon2001

Programmer
May 16, 2001
22
US
When I subtract one date from another, the result is in days. How can I get the result in years?
ie date of birth 2/1/1980
report date 5/1/01
person's age should show as 21.25 years, not 7700 days.
21 years and 3 months would also be a good format
Thanks in advance
 
DateDiff() can give you the result in years (integer result).
Also,
DateSerial(0,0,PrintDate - {BirthDate}) will give you an result in a date format(ie years, months, and days old). This can be formatted to show all or part of the info.
Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top