Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last day of month, last tuesday of month, etc
Message
De
10/03/2008 12:34:18
 
 
À
10/03/2008 11:09:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01300363
Message ID:
01300542
Vues:
15
thanks!

>Updated code and tested...
>
>
>*  Call passing the day number of week to test for and current date
>*  Returns:  1 after date
>*            2 before date
>*            3 equals date
>*            0 indeterminate (error)
>
>FUNCTION LastDaySelect
>LPARAMETERS pnLastDay,pdCurDate
>LOCAL ldLastDayofMonth, lnLastDay, lnDate
>ldLastDayofMonth = GOMONTH(DATE(YEAR(pdCurDate),MONTH(pdCurDate),1),1) - 1
>lnLastDay = DOW(ldLastDayofMonth)
>IF (lnLastDay - pnLastDay) > 0
>  ldTestDayofMonth = ldLastDayofMonth - (lnLastDay - pnLastDay)
>ELSE
>  ldTestDayofMonth = ldLastDayofMonth - (pnLastDay + lnLastDay) + 1
>ENDIF
>DO CASE
>  CASE ldTestDayofMonth < pdCurDate
>    lnDate = 1
>  CASE ldTestDayofMonth > pdCurDate
>    lnDate = 2
>  CASE ldTestDayofMonth = pdCurDate
>    lnDate = 3
>  OTHERWISE
>    lnDate = 0
>ENDCASE
>RETURN lnDate
>ENDFUNC
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform