Changing the sort order of a union query

_JSincliar

Registered User.
Local time
Today, 11:23
Joined
Dec 9, 2009
Messages
16
I have a which combines the results of a few other queries. When I run it, Access automatically sorts it alphabetically on the first column. Instead, I would like it to preserve the order in which the input queries are written. ie,

Code:
SELECT  Content FROM qryFormatT1
UNION
SELECT  Content FROM qryFormatTT;
qryFormatT1 returns,
a
d
h

qryFormatTT returns.
c
r
e

Result of the union: (sorted alphabetically):
a
c
d
e
h
r

I want: (one query sitting on top of the other, not sorted):
a
d
h
c
r
e

Any help is appreciated
 
Try

SELECT Content, 0 AS SortField FROM qryFormatT1
UNION
SELECT Content, 1 AS SortField FROM qryFormatTT
ORDER BY SortField
 

Users who are viewing this thread

Back
Top Bottom