Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of days in a month
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00053634
Message ID:
00053909
Views:
23
>Is there a function to get the number of days in a month.
>eg. the number of days in any month of any year.
>
>Thanks
>Andrew

Sometime ago I wrote a 10 line function to simply determine the last day of the current month. I kept adding days until the date function determined the data was invalid. Something like this:
...
For I = 1 to 31
lcChkDate=Month...+"/"+STR(I,2)+"/"+Year...
...
IF DATE(lcChkDate)=" / / "
* Invalid Date take Previous I (Day) (I-1)
* as last Day of Current Month

* Define variable here ldDate=DATE(lcChkDate)
EXIT
ENDIF
Endfor
Steve Medvid
Systems Analyst

Environmental Resource Management
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform