Information générale
Catégorie:
Codage, syntaxe et commandes
This depends on SET DATE (and SET CENTURY if the year is on the first place in SET DATE). :(
Vlad
>Hi! Jim!
>
>you can try the following:
>
>ldDate = {31.03.97}
>lcSeparator = substr(dtoc(ldDATE),3,1)
>ldBegDate =CTOD([01]+lcSeparator+substr(dtoc(ldDate),4))
>ldEndDate = gomonth(ldBegDate,1)-1
>
>May be it be it not so short but it always return correct result...
>
>Have a happy day
>Vladimir Shevchenko
>
>> I think mine will work more often. Yours would fail for certain dates
>> where the previous month had less days than the curretn month, tyr this >
>?GoMonth(ldDate,1)-day(gomonth(ldDate,1)) && returns 3/31/97 correctly
>> ?GoMonth(ldDate-day(ldDate),1) && Returns 3/28/97 incorrectly because
>> Feburary has only 28 days
>>
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement