dynamite9585
Registered User.
- Local time
- Tomorrow, 02:25
- Joined
- Jul 4, 2010
- Messages
- 34
Absolute Newbie here. help with Datediff. (SOLVED)
I am writing a database for a youth organiseation i am involved with.
i need a fields for:
age (years and months from [DateOfBirth] to today)
ageforcourse (years and months from [DateOfBirth] a specified date , possibly [coursedate] if i do [coursedate] it will be from another table, and that might be getting comlicated)
and Length of Service (years and months from [DateJoined] to today)
have wasted almost a whole day trying to work this out, so any help would be appreciated....
also if some of you are kind enough to write VB code for me, please also incluse how to make it work
Solution
substitute [Date Joined] with [DateOfBirth] for the age one.
havn't worked on [coursedate] yet but thats a wee while off getting to the point.
I am writing a database for a youth organiseation i am involved with.
i need a fields for:
age (years and months from [DateOfBirth] to today)
ageforcourse (years and months from [DateOfBirth] a specified date , possibly [coursedate] if i do [coursedate] it will be from another table, and that might be getting comlicated)
and Length of Service (years and months from [DateJoined] to today)
have wasted almost a whole day trying to work this out, so any help would be appreciated....
also if some of you are kind enough to write VB code for me, please also incluse how to make it work
Solution
Code:
=DateDiff("yyyy",[Date Joined],Now()) & " yrs " & DateDiff("m",[Date Joined],Now())-(DateDiff("yyyy",[Date Joined],Now())+Int(Format(Now(),"mmdd")<Format([Date Joined],"mmdd")))*12 & " mts"
substitute [Date Joined] with [DateOfBirth] for the age one.
havn't worked on [coursedate] yet but thats a wee while off getting to the point.
Last edited: