Board index » off-topic » Sort a query
Sort a query
2004-12-08 10:56:49 PM
I have a question..
I use a TQuery object to query a database and I want to sort the results of
If I add "ORDER BY..." in my query, can I declare a param for the name of
the field I want to sort by ?
For example, the propriety SQL of my TQuery object could be :
"SELECT * FROM Table ORDER BY :FieldParam"
If it's possible, which "DataType" must I choice for the param ?
And else, what's the best solution to change easily the sort of my query ? I
want to show the result in a TDBGrid, and I want to let the user of my
application change the field to sort by dynamically.
Thanks for your help.