[Remind-Fans] 5th business day of the month

Harold Ditchfield hditchfield at shaw.ca
Sat Oct 16 08:13:58 EDT 2010


Hey All

A question if I could

I have a requirement for identifying the 5th business day of the month. This would omit holidays, SAT and SUN. so the 5th business day would normally fall anywhere between the 5th and the 8th of the month

Examples
- If Mon is the 1st and there are no holidays then the 5th business day would be the 5th of the month
- If Tue is the 1st and there are no holidays then the 5th business day would be the 7th of the month (skipping SAT+SUN)
- If Tue is the 1st and the 1st is a holiday then the 5th business day would be the 8th of the month (skipping holiday, SAT + SUN)

I have come up with some code that appears to be working correctly but was wondering if there is a more elegant solution than the one I came up with

Code (presupposing OMITs for holidays are defined elsewhere)
...
SET FIRST date( year( today() ), monnum( today() ), 1 )

IF [ nonomitted( FIRST, today(), "SAT", "SUN"  ) == 4 ] 
   REM [ today() ] +3 OMIT SAT SUN AFTER MSG 5TH Business DAY %b.% 
ENDIF 

...

Thanks
Harold


More information about the Remind-fans mailing list