Leap Year Date Problem

  • Thread starter Thread starter Cathy
  • Start date Start date
C

Cathy

This one should be quick and easy for this audience...

I have a query where included in the select statement I
have added the following:

([tblDates].[End_Date]-365) AS PriorYR_End_Date

Of course, it doesn't work properly this year because of
leap year...

How can I ammend the query to subtract one year instead of
365 days?

Thank you!
Cathy
 
Cathy,

Try using the DateAdd() function to do date arithmetic:

DateAdd("yyyy", -1, #12/31/2004#)

You can replace the date literal above with your field name:

DateAdd("yyyy", -1, [tblDates].[End_Date])

hth,
 
Back
Top