Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting Question
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00466702
Message ID:
00466797
Views:
8
I found the problem. I was giving the same name to the field in my cursor as the original table - sele val(xyz) as xyz. Once I changed this - sele val(xyz) as abc - it worked fine. It doesn't do this in your sample if I change to xyz to cField, though. Well, that's odd.

Regards,

E.R.

>>It looks like the sort is happening before the val conversion because negative numbers aren't at the top. Is there anything I can do in the SQL statement to make this work correctly?
>
>Works fine for me:
>
>
CREATE CURSOR temp1 (cField c(10))
>APPEND BLANK
>REPLACE cField WITH '3'
>APPEND BLANK
>REPLACE cField WITH '2'
>APPEND BLANK
>REPLACE cField WITH '-1'
>APPEND BLANK
>REPLACE cField WITH '9'
>SELECT VAL(cfield) as xyz FROM temp1 ORDER BY xyz
>
>Shows, -1, 2, 3, 9 for me.
Regards,

E.R. Gilmore
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform