Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT - SQL, Using Memory Variable With
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00319625
Message ID:
00319627
Views:
12
Use macro substitution...

ORDER BY &mOrderBy

or try

ORDER BY (mOrderBy)

>In trying to use a memory variable in the ORDER BY clause of a SELECT statement, I am getting the following error message...
>
>"SQL: Column 'MORDERBY' is not found.
>
>The code I am trying to run is as follows...
>
>DO CASE
>	* CASE Order By Cust
>	CASE ThisForm.optOrderBy.optOrderByCust.Value = 1
>		STORE "Cust, OrdDate, Invoice, Prodct" TO mOrderBy
>
>	* CASE Order By Product
>	CASE ThisForm.optOrderBy.optOrderByProduct.Value = 1
>		STORE "Prodct, OrdDate, Cust, Invoice" TO mOrderBy
>
>ENDCASE
>
>SELECT * ;
> FROM InvHist ;
> INTO ARRAY arrInvHist2 ;
> ORDER BY mOrderBy
>
>
>Would appreciate any help if somebody knows of a way to do accomplish this (or something akin to it). TIA, Chuck.
Previous
Reply
Map
View

Click here to load this message in the networking platform