e3digital Posted January 12, 2004 Posted January 12, 2004 I have inherited a database and need to be able to calculate a student's current age. I wanted to just do a simple calc: (Today-DOB)/365. However, there is no DOB field. Instead, there is MonthofBirth, DayofBirth, and YearofBirth, all three of them text fields. I tried to write a calc: MonthofBirth &"/"& DayofBirth &"/"& YearofBirth, but it doesn't work. What is the best way to get Current Age out of this? Thanks, Susan
Lee Smith Posted January 12, 2004 Posted January 12, 2004 I didn't test this, but off of the top of my head this should work. Date(Month(MonthofBirth), Day(DayofBirth), Year( YearofBirth)) HTH Lee
e3digital Posted January 12, 2004 Author Posted January 12, 2004 Thanks, but this doesn't work.... This fields look like this: MonthofBirth, text, data=04 DayofBirth, text, data=01 YearofBirth, text, data=1966 So I want to end up with a date field that looks like this: 04/01/1966 Thanks again. Susan
Ugo DI LUCA Posted January 12, 2004 Posted January 12, 2004 MonthofBirth, text, data=04 DayofBirth, text, data=01 YearofBirth, text, data=1966 Date(MonthofBirth, DayofBirth, YearofBirth) should lead you there ?
Lee Smith Posted January 12, 2004 Posted January 12, 2004 That's funny, it works for me. What didn't work for you, the leading zeros. If so, you may have to adjust the Date format at the layout level. Lee
e3digital Posted January 12, 2004 Author Posted January 12, 2004 Yes, this works...Date(MonthofBirth, DayofBirth, YearofBirth)...don't know what I was doing before Thanks. Susan
Recommended Posts
This topic is 7691 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now