Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need last day of month, 2nd wednesday ...stuff like that
Message
 
To
30/10/2003 17:53:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00844758
Message ID:
00844764
Views:
12
Well the last day of the month part was easy...

CTOD(LEFT(DTOC(GOMONTH(DATE(),1)),3) + '01' + Right(DTOC(GOMONTH(DATE(),1)),5)) -1

Don't have the other parts yet though...

>No, I haven't done this already, but I'll see whether I can help.
>
>>I need some fancy date functions....
>>First, I need to know the last day of a givin month...
>
>You can go to the first of the next month, and subtract one. For instance, for month 5, 2003, you can use date(2003, 5+1, 1) - 1. Additional adjustments are required for month 12.
>
>>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.
>
>I would just loop through the first days of the month, until you find a Thursday. Then, to get the 4th. Thursday, add 7 * (4-1) days.
>
>HTH,
>
>Hilmar.
ICQ 10556 (ya), 254117
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform