Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL-Select from VFP table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01183357
Message ID:
01183384
Views:
19
As long as you're not interested in negative values (A-Z)
Select * from mytable where VAL(myfield ) < 2
>Here's an unusual question (or at least this seems unusual to me):
>
>I have a VFP table that contains (among other things) a character field containing the values 0-50 as well as the values A-Z.
>
>In this client's data, A-Z represents quantifiable values less than zero, even though this field is a character field in the table.
>
>Assuming the table name is "mytable" and the character field I am referring to is named "myfield", If I wanted to select all records where myfield contains a "value" less than "D" for example, how would I do so? I can't change the structure of the table, etc (tons of legacy data) and if I run a select statement such as:
>
>Select * from mytable where myfield < "2"
>
>then I obviously get records back where myfield = "12", "19", etc (since the data is stored as a character, "12" is seen as less than "2", etc). Using VAL() on the field in advance doesn't work as part of the SQL-Select statement.
>
>Any suggestions on a quick solution? My hands are tied on how the data in this field is stored.
>
>Thanks,
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform