Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need last day of month, 2nd wednesday ...stuff like that
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00844758
Message ID:
00844771
Views:
14
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....
Previous
Reply
Map
View

Click here to load this message in the networking platform