Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect range
Message
 
To
15/07/2005 05:42:43
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01032949
Message ID:
01032958
Views:
12
This message has been marked as the solution to the initial question of the thread.
>Dear Experts
>
>I have table1 contaning only one CHARACTER field entitled "class".
>It has data as follows
>
>3000-5000
>5001-10633
>10634-13216
>10217-100000
>
>and there is NUMERIC textbox. It is equal to 12850
>
>How to check inwhich class it belongs to?
>It belongs to or it is in third class, 10634-13216, but how to check programtically?
>
>Please help
SELECT YourTableAlias
SCAN
   lnPos  = AT([-], Field1)
   lnLow  = VAL(LEFT(Field1, lnPos-1))
   lnHigh = VAL(SUBSTR(Field1, lnPos+1)
   IF BETWEEN(NumericTextBox.Value,lnLow,lnHigh)
      HERE
   ENDIF
ENDSCAN
or
#define lnPos AT([-], Field1)
#define lnLow  VAL(LEFT(Field1, lnPos-1))
#define lnHigh VAL(SUBSTR(Field1, lnPos+1)

m.Number = NumericTextBox.Value
SELECT Field1 FROM YourTable WHERE BETWEEN(m.Number, lnLow, lnHigh) INTO ...
(not tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform