FUNCTION Fdow1 LPARAMETERS lnYear, lnFirstWeek, lnFirstDay ****************************************************************************** * Fdow1(expN1, expN2, expN3) * expN1 = Year * expN2 = Regional setting of what's first week of year * expN3 = Regional setting of what's first day of week * * Returns the first day of a week that has week number 1. This could be a date * the previous year. * * Return type: date ****************************************************************************** LOCAL ldRetVal IF EMPTY(lnFirstWeek) lnFirstWeek = SET("FWEEK") ENDIF IF EMPTY(lnFirstDay) lnFirstDay = SET("FDOW") ENDIF lnI = 1 ldRetVal = DATE(lnYear, 1, lnI) DO WHILE WEEK(ldRetVal, lnFirstWeek, lnFirstDay) > 1 lnI = lnI + 1 ldRetVal = DATE(lnYear, 1, lnI) ENDDO ldRetVal = ldRetval - DOW(ldRetVal, lnFirstDay) + 1 RETURN ldRetVal>Hi everybody,