function howmanysundays lparameter DayOne && hold the start date local ThisManySundays && hold howmany ThisManySundays=0 for i = 0 to 31 if month(dayone+i)<>month(Dayone) && am I still in the right month? exit endif if dow(dayone+i)=1 ThisManySundays=ThisManySundays+1 endif endfor return i-ThisManySundays &&Return how many working days are in this monthThank you for your help any way