Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using expression in ORDER BY clause
Message
From
19/10/2001 16:50:12
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00570371
Message ID:
00571151
Views:
22
1. If numeric expression works, why the following code will not work:
norder = 1
CREATE CURSOR test ( test c(1) )
SELECT * from test ORDER BY 0+norder
Result: SQL: ORDER BY clause is invalid Why ?

2. If I'm using name expression why the following code will not work:
CREATE CURSOR test ( test c(1) )
SELECT * from test ORDER BY ('test')
Result: SQL: Column '' not found error. Why ?



>In the test code you are using a name expression not a numeric expression. Following works
>
SELECT * from test ORDER BY 2+3-4
>* or
>norder = "1"
>SELECT * from test ORDER BY &norder
>
>
>>From VFP 7 help:
>>
>>Each Order_Item must correspond to a column in the query results and can be one of the following:
>>...
>>A numeric expression indicating the location of the column in the result table.
>>
>>However, the following program causes error
>>
>>SQL: Column 'NORDER' is not found.
>>
>>How to use expressions in ORDER BY clause ?
>>
>>
>>norder = 1
>>CREATE CURSOR test ( test c(1) )
>>SELECT * from test ORDER BY (norder)
>>
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform