Hey folks

I'm looking to find the best way of taking the current date and figuring out if it is the first Monday, first Tuesday, first Wednesday (carry on for rest of week), second Monday, second Tuesday (carry on), third Monday (carry on), fourth Monday (through Friday).

I've got a first Monday custom function that I could modify to make into first Tuesday etc but this would mean a whole bunch of custom functions and something like a massive case statement to figure out if the current date equals the date calculated by all these.

Maybe that's the way it needs to be, but thought I would throw it out there for other ideas.

As always, many thanks.

this should work:

CF: NthDayOfWeek( _date )

Let ( [

_day = Day ( _date )

; _dayname = DayName ( _date )

; _nth = Div ( _day - 1 ; 7 )

; _nthstr =

Case (

_nth = 0 ; "first"

; _nth = 1 ; "second"

; _nth = 2 ; "third"

; _nth = 3 ; "fourth"

; _nth = 4 ; "fifth"

; "" )

] ;

_nthstr & " " & _dayname

)

Regards

Otmar