Hi,
I have a qry with multiple columns. The first column contains the name of one of the columns in my query. I need to sort the results on the column (name) contained in the first column.
my query looks something like this:
SELECT qry1.qry_sort_col, qry2.qry_location, qry2.qry_num_part, qry3.qry_score, qry3.qry_count
FROM "multiple qrys joined here"
WHERE qry_location is not null
Order By (dlookup("qry_sort_col","qry1"))
the first column contains the column name qry_location which means that I am trying to sort the result set on qry2.qry_location in asc order
If I type Order By qry2.qry_location - everything works great
Problem - I don't know ahead of time what will be in the first column (the user gets to select the field they want the reslts sorted by) so I need to pull the column name out of the first column in my qry. I thought I could use DLookup to do this. I can show in the result set that I am returning the column name with the dlookup call but the sort will not work.
Thanks for any ideas!