Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Months to a Date
Message
From
01/07/1999 16:49:57
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00236456
Message ID:
00236715
Views:
13
>>>What is the best way to handle adding months to a date. My user would like me to establish a from date and a to date on a form. The from date is pretty straight forward and will always be the first day of the month (e.g 12/01/1999 or /05/01/1999). Now the tricky part is that they want me to calcualte the to date based on a variable called lead time. The lead time contains the number of months of lead time. So what is the best way to figure out the to date when we have a from date of say 12/01/1999 and the lead time is 17 months. Any help would be appreciated.
>>
>>I guess the first question is what do they mean by "month". Is it 30 days, or 4 weeks or the actual calendar month?
>
>The lead time will always be a number to represents months. So if the value in lead time is 13 they wish 13 months added to the from date to get the to date.

PMFJI: Have you ever seen the GOMONTH() function? It does exactly that for calendar months, and is even leap-year sensitive... GOMONTH({7/1/1999}, 13) = {8/1/1999}. (Yeah, I know its not StrictDate format....)

HTH

Rob
Previous
Reply
Map
View

Click here to load this message in the networking platform