Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date Math
Message
From
09/03/2004 10:26:38
 
 
To
09/03/2004 10:22:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00884427
Message ID:
00884428
Views:
43
>Is there a simple way to manage leap year when doing calculations based on dates? The program I am working on processes records on an annual basis. Sometimes the records are terminated before the end of a full year and sometimes they are increased or decreased before a full year. Because of leap year some years have 364 days and others have 365. Does FoxPro have a built in way to deal with this, or is there an easy way to program for this anomaly?

Instead of doing math with the dates can you use the GOMONTH feature?
IF GOMONTH(startdate, 12) < enddate 
  *-- This is less than a year.
ELSE
  *-- A year or more.
ENDIF
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Reply
Map
View

Click here to load this message in the networking platform