try this:
- formula to calculate the nth week day in a month (the 2nd Tuesday in april)
NQ = 7*Q - 6 + (N - DoW(date(Year, Month, 1), 2))%7.
Q = ocuurence of the weekday
N = number of the weekday (0=Sunday)
7*1 - 6 + (5 - DoW(date(Year, Month, 1), 2))%7.
So, to find the first Friday using the above equations, use Q=1, N=5;
the third Monday is found using Q=3, N=1, etc.
>I need some fancy date functions....
>First, I need to know the last day of a givin month...
>
>Then I also need to be able to determine the 1st, 2nd, 3rd, 4th, last [monday, tuesday, whatever] day of the month.
>In other words, the user would select the 4th Thurday of Oct, 2003 - I need a way to know that is Thurday Oct 23, 2003.
>
>This seems like something that would be a fairly common need - has anyone got anything like this already?
>
>Thanks....