Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many Sundays in a month?
Message
From
22/03/2001 13:23:39
 
 
To
21/03/2001 18:09:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00487391
Message ID:
00487694
Views:
7
Rod,
I though I may as well toss my contribution into the pot - which answers two minor issues with your otherwise elegant 1 line solution:
1) You have to provide the Year and Month to the function as numerical values - it might be easier to provide a date.
2) It only works with VFP and not in Fox 2.6 - the date() function is different.

I know - I said they were minor....:)

So here is my contribution:
? int((day(gomo(mydate-day(mydate)+1,1)-1) - ;
      (iif(dow(mydate-day(mydate)+1)=1,0,8-dow(mydate-day(mydate)+1))) + ; 
       7-dow(gomo(mydate-day(mydate)+1,1)-1))/7)	
It appears to provide the correct results for the months I have tested.
Sam Robbins BCRTC
Previous
Reply
Map
View

Click here to load this message in the networking platform