Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateAdd with year

Status
Not open for further replies.

JonFer

Programmer
Nov 7, 2003
868
US
Has anyone noticed problems with using the DateAdd() function and the year ("y") parameter? This is with Access 97. It's probably a leap year thing but if I add a lot of years (e.g. 100), it gets off by a few months. If I switch to using months, it works fine.


John
 
Have you tried "yyyy" as Interval ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That's because "y" doesn't add years ... it adds "day of the year" and is (far as I can tell) equivalent to

DateAdd ( "d", n, Date() )

To add years, try

DateAdd ( "yyyy", n, Date() )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top