Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
That's a smiley way to start your day
Message
From
29/02/2000 13:32:54
 
 
To
29/02/2000 13:23:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00339259
Message ID:
00339301
Views:
18
>>Michel,
>>
>>>>dRenewDate = GOMONTH(dExpireDate,12)
>>>
>>>As I replied to Fred, it returns Feb 28 and not March 1. Since there isn't a 29 next year, isn't suppose to return March 1?
>>
>>Try this:
newdate=IIF(RIGHT(DTOS(olddate),4)="0229", ;
>>gomonth(olddate,12)+1, ;
>>gomonth(olddate,12))
>
>That'll do it.

That'll only do part of it, if your purpose is for everyone to get the same number of days. What about those who renewed on January 15, 2000? GOMONTH(oldate,12) will bring them to January 15, 2001, which is 1 day longer than someone renewing on March 15, 2000, since the January renewal gets the 02/29/2000 for free. Try this:
? {^2001-01-15}-{^2000-01-15}
? {^2001-03-15}-{^2000-03-15}
Better to just add 365 days to the date and be done with it.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform