Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many Sundays in a month?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00487391
Message ID:
00487405
Views:
8
Try this:
FUNCTION countSundays
LPARAMETERS pnYear, pnMonth
LOCAL ldDate1, ldDate2
ldDate1 = date(pnYear, pnMonth, 1)
ldDate2 = gomonth(ldDate1, 1)

return int((d2-d1+dow(d1)) / 7)
ENDFUNC

Hi All, What would be the best approach to find out how many Sundays are with in a month?
>
>would I have to iterate each day, and count how many dow()=1 and count them between the first of the month and last off the month?



HTH,
- Erik Niese-Petersen

Crazy Dane in USA.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform