Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can a name expression be used in the ORDER BY clause?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01321710
Message ID:
01321722
Views:
9
Naomi (and Sergei)

Thanks to you for your lightening fast reply.

I thought I had tried a macro as well and it didn't work. But, it obviously does.

Jim

>>Can a name expression (or Macro) be used in the ORDER BY clause of a SELECT statement? I have tried the following, but get an error.
>>
>>
>>m.lcSQLSortCol = "lastname"
>>
>>SELECT PatientID, lastname, firstname FROM Patients INTO CURSOR csrResult ;
>>  ORDER BY (m.lcSQLSortCol)
>>
>>
>>I get the error: SQL: Column 'LCSQLSORTCOL' is not found
>>
>>Thanks for your help.
>>
>>Jim
>
>Macro can be used. Nothing else.
>
>SELECT PatientID, lastname, firstname FROM Patients INTO CURSOR csrResult ;
> ORDER BY &lcSQLSortCol
>
>Same rule applies for all other parts of select statement.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform