>Has anyone had to figure out how many pay periods, paid bi-weekly, there are in each quarter of the year - for many years to come?
Hi Ken
I put code below together w/o much testing but it seems return correct results. Keep in mind that tdPayDate has to be before beginnig of a quarter or result will be incorrect.
LPARAMETERS tnYear, tnQuarter, tdPayDate
LOCAL ldQstart, ldQend
IF NOT BETWEEN(tnQuarter,1,4)
RETURN 0
ENDIF
ldQstart = DATE(tnYear, (tnQuarter-1)*3 + 1, 01)
ldQend = GOMONTH(ldQstart,3) - 1
RETURN INT((ldQend - tdPayDate) / 14) - CEILING((ldQstart - tdPayDate) / 14) + 1
--sb--