Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need last day of month, 2nd wednesday ...stuff like that
Message
 
À
30/10/2003 17:53:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00844758
Message ID:
00844764
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform