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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating dates in Approach97

Status
Not open for further replies.

jimmyi

Technical User
Nov 30, 2002
2
0
0
US
Please tell me if it is possible and if so the formula to subtract one date field from another and get the number of years for an answer. Thanks.
 
Subtracting one date from another gives you a number answer equal to the number of days between the two dates. Divide that number by 365.25 to get the number of years and a fraction.

Something like this:
NumYears = (date2 - date1)/365.25

To eliminate the fraction do this:
NumYears = Trunc((date2 - date1)/365.25)

Sue Sloan
XpertSS.com
 
I'm trying to do something similar to this question and can't seem to find the correct formula. I have an Age field that I want calculated from my Date Of Birth Field automatically. But I need it to be how old was that child on December 31, 2002. When I changed my date on my computer to say 12/31/02 and in the value section of my formula I put the following:

(Today() - DOB) / (365.25)

It puts something like 10.945666 and I just want it to say 10.

What am I doing wrong?

Thanks for your help in advance!!!!!!!!
Michelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top