[Remind-Fans] 5th business day of the month
hditchfield at shaw.ca
Sat Oct 16 11:48:01 EDT 2010
Works like a charm
On 2010-10-16, at 9:38 AM, David F. Skoll wrote:
> On Sat, 16 Oct 2010 06:13:58 -0600
> Harold Ditchfield <hditchfield at shaw.ca> wrote:
>> 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
>> 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.%
> If you are using the latest Remind, you can use the built-in "slide"
> and "evaltrig" functions:
> REM [slide(evaltrig("1 OMIT SAT SUN AFTER", today()-15), 4, "Sat", "Sun")] +3 \
> MSG 5th Business Day %b.
> So looking at it from the inside out:
> evaltrig("1 OMIT SAT SUN AFTER") gets you the *first* business day of the
> month. We start scanning from 15 days ago because otherwise (for example)
> if we evaluate the trigger on October 2nd, the Remind algorithm would
> pick a date in *November*, which is too far in the future.
> Once we have our first business day of the month, we use the slide
> function to slide forward by 4 days, not counting globally-omitted days
> or weekends.
> Remind-fans mailing list
> Remind-fans at lists.roaringpenguin.com
> Remind is at http://www.roaringpenguin.com/products/remind
More information about the Remind-fans