Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One month after today
Message
From
04/08/2009 23:24:57
 
 
To
04/08/2009 21:30:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01416137
Message ID:
01416142
Views:
91
>how can I add one month to the date?

Use the GOMONTH function. But note that it has some "features" -- see below:
ldDate = {^2009-01-30}
?GOMONTH(ldDate,1)                  && Returns 02/28/2009
?GOMONTH(ldDate,2)                  && Returns 03/30/2009

ldDate = GOMONTH(ldDate,1)    && Sets date to 02/28/2009
ldDate = GOMONTH(ldDate,1)    && Sets date to 03/28/2009; this has now lost 2 days from the above
In the above the GOMONTH function moves the current date ahead one month; but if the next month does not have the day number then the last day number is used. If you are always wanting a fixed day of the month, then be aware of the effect for dates after 28 for Feb and the other months that only have 30 instead of 31.
Previous
Reply
Map
View

Click here to load this message in the networking platform