Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Character Calculation
Message
 
À
25/07/2005 06:35:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01035636
Message ID:
01035639
Vues:
9
This message has been marked as the solution to the initial question of the thread.
>Dear Experts
>
>There are two variables
>
>cvar1="05-2005" && May 2005
>cvar2="10-2005" && Oct 2005
>
>How to check programatically which variable, I mean which month, is greater?
>
>Please help
>
>Thanks in advance

What do you mean which month?
"01-2006" is greater then "10-2005" as a period but as a month 10 is greater then 1.
If you want to see what period is greater then other, in addition to Graig's answer you can use:
? CHRTRAN(cVar1,"-","") < CHRTRAN(cVar2,"-","")
? cVar1 < cVar2

but if you want to compare just a month portion
? VAL(LEFT(cVar1,2)) < VAL(LEFT(cVar2,2))
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform