Absolute Newbie here. help with Datediff.

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

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:
First up welcome to the forum.

Have a look at this thread, which discusses this very subject post #15 is probably just what you are looking for.
 
the one still had be lost.
but it did link me to one that did help, thanks
 

Users who are viewing this thread

Back
Top Bottom