Click to See Complete Forum and Search --> : How to add 12 months to the CurrentDate


Surrender79
November 16th, 2004, 06:28 AM
Ciao, i'm using Crystal Report 6 and I have a formula field which must show the currentdate + 12 months, i.e.: today is 16/11/2004, i need 16/10/2004.

Could you help me?
I'm trying the data functions but i'm not able to solve my problem :-\

Surrender79
November 16th, 2004, 06:52 AM
Solution:
CurrentDate + 365

Ops... :-p
Ciao :-)

springsoft
November 17th, 2004, 04:30 PM
above solution works except for Leap years......
alternative is :
formula = dateAdd("m", 12, CurrentDate)

you can do add and subtract arithmetic on dates using DateAdd.
1st paremeter = either "d", "m", or "y",
2nd parameter is amount you want to inbcrement or decrement by,
last parameter is date you want to use as basis of calculations

Dave