home *** CD-ROM | disk | FTP | other *** search
- *********
- * EOW
- * by Tom Rettig
- * modified by Leonard Zerman
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * Syntax: EOW( <expD> )
- * Return: Date of the first Sunday same as or following <expD>
- * Note : To make this function return Friday instead of Sunday,
- * replace the conditions specified below.
- *********
-
- FUNCTION EOW
- *
- PARAMETERS tr_date
-
- DO CASE
- CASE DOW(tr_date) = 1 && replace 1 with 5 to return Friday
- RETURN tr_date
- CASE DOW(tr_date) = 2 && replace 2 with 7 to return Friday
- RETURN tr_date + 6
- OTHERWISE
- RETURN tr_date + ( 8 - DOW(tr_date) )
- ENDCASE && replace 8 with 2 to return Friday
- * eofunc EOW
-
-