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.