Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Character Calculation
Message
 
To
25/07/2005 06:35:34
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01035636
Message ID:
01035639
Views:
11
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform