LPARAMETERS ldDate LOCAL ldStart, ldEnd, ldLastOfMonth && You can replace this with ldStart = DATE() && and remove the LPARAMETERS line if you want && or you can call this procedure with DATE() && as the parameter. I just find it more && flexible this way... ldStart = ldDate && Go back to the previous Friday, or first of the month, && whichever comes first DO WHILE DOW(ldStart) <> 6 AND DAY(ldStart) > 1 ldStart = ldStart - 1 ENDDO && Check to make sure there are at least 3 days && before, so the previous week will have at && least 3 days IF ldStart - DATE(YEAR(ldStart), MONTH(ldStart), 1) < 3 && Not enough days, so we must include them ldStart = DATE(YEAR(ldStart), MONTH(ldStart), 1) ENDIF && Similar process for ldEnd && Same thing about the LPARAMETER statement... ldEnd = ldDate ldLastOfMonth = GOMONTH(DATE(YEAR(ldEnd), MONTH(ldEnd), 1), 1) - 1 DO WHILE DOW(ldEnd) <> 5 AND ldEnd < ldLastOfMonth ldEnd = ldEnd + 1 ENDDO && Check to make sure there are at least 3 days && in the next week IF ldLastOfMonth - ldEnd < 3 && Include them! ldEnd = ldLastOfMonth ENDIF ? "Week is from " + DTOC(ldStart) + " to " + DTOC(ldEnd)