D
Douglas J Steele
Union queries only accept a single ORDER BY, which applies to the entire
query, not just to subqueries. Get rid of the parentheses.
SELECT 0, " - All -"
FROM MasterEvent
UNION
SELECT MasterEventID, [MasterLocationName] & ": " & [MasterEventDate]
FROM MasterEvent
ORDER BY 1 DESC;
Yes, this means that your "All" row will be at the end. If that's a problem,
try adding a 3rd field for sort purposes only. For the first subquery, you'd
put a very large number there, whereas you'd repeat MasterEventID in the
second subquery:
SELECT 0, " - All -", 99999999
FROM MasterEvent
UNION SELECT MasterEventID, [MasterLocationName] & ": " & [MasterEventDate],
MasterEventID As SortKey
FROM MasterEvent
ORDER BY 3 DESC;
query, not just to subqueries. Get rid of the parentheses.
SELECT 0, " - All -"
FROM MasterEvent
UNION
SELECT MasterEventID, [MasterLocationName] & ": " & [MasterEventDate]
FROM MasterEvent
ORDER BY 1 DESC;
Yes, this means that your "All" row will be at the end. If that's a problem,
try adding a 3rd field for sort purposes only. For the first subquery, you'd
put a very large number there, whereas you'd repeat MasterEventID in the
second subquery:
SELECT 0, " - All -", 99999999
FROM MasterEvent
UNION SELECT MasterEventID, [MasterLocationName] & ": " & [MasterEventDate],
MasterEventID As SortKey
FROM MasterEvent
ORDER BY 3 DESC;