home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Workdays
-
- PARAMETERS _date1, _date2, _exceptions
-
- PRIVATE _warray, _totdays, _totsats, _busdays, _qaz
-
- IF PCOUNT() < 2
- RETURN(0)
- ENDIF
-
- IF _date2 < _date1 && End date less than beginning date
- RETURN(0)
- ENDIF
-
- _warray = ( PCOUNT() = 3 )
-
- _totdays = _date2 - _date1
- _totsats = (INT(_totdays / 7 ) + IF( ( DOW(_date2) < DOW(_date1) ), 1, 0 )) * 2
- _busdays = _totdays - _totsats
- IF _warray
- FOR _qaz = 1 TO LEN(_exceptions)
- IF _exceptions[_qaz] >= _date1 .AND. _exceptions[_qaz] <= _date2
- _busdays = _busdays - 1
- ENDIF
- NEXT
- ENDIF
- RETURN(_busdays)
-
- * End of File
-
-
-
-
-
-
-