Calculate the age

  • Thread starter Thread starter Reg Vaz
  • Start date Start date
R

Reg Vaz

Hi,
I am trying to calculate the age of a product in
Years/Month format, and was wondering how i could go about
doing this....

Thnx
Reg
 
Reg,

SELECT Abs(DateDiff("yyyy", Date1, Date2) - IIf(Format(Date1, 'mmdd') <=
Format(Date2, 'mmdd'), 0, 1)) & ' years ' & DateDiff('m', DateAdd('yyyy',
Abs(DateDiff('yyyy', Date1, Date2) - IIf(Format(Date1, 'mmdd') <=
Format(Date2, 'mmdd'), 0, 1)), Date1), Date2) & ' months' As ProductAge FROM
tblMyTable

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top