Add a number of years onto a date field in MS Access
I have one field called DateOfIssue (Date Field - i.e. 1 January 2001)and one called Expiry (which is a number field i.e. 3) which is the number of years until this certificate expires. I need to add the Expiry onto the Date of Issue and come up with an Expiry date.
I am sure I have done this before but after searching my knowledgebase and then Experts Exchange I cannot find exactly what I need.
I am sorry folks I am really feeling quite stupid here but I cannot make it work
My fields are called
ExpiryDate
NoYearsTillExpiry
DateOfIssue
I have the following
DateAdd("yyyy" (this is where I think I am going wrong),[NoYearsTillExpiry],[DateOfIssue]
And I am getting nowhere, I really appreciate your help though
Cluskitt
It's just "y", not "yyyy". "y" defines the measure to be calculated, in this case years, not format. If you want to format, you have to Format("yyyy",Dateadd("y",[NoYearsTillExpiry],[DateOfIssue]))
http://www.databasedev.co.uk/ms_access_date_functions.html
Raj