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