Re: Union Select sorting

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Van T. Dinh (VanThien.Dinh_at_discussions.microsoft.com)
Date: 05/29/04


Date: Sat, 29 May 2004 11:12:37 +1000

A work-around is to include the "hidden" Field in the Union Query then
create a new Select Query using the Union Query as the DataSource. Include
all other Fields (i.e. excluding the "hidden" Field) in the return list and
sort by the "hidden" Field.

--
HTH
Van T. Dinh
MVP (Access)
"JR" <anonymous@discussions.microsoft.com> wrote in message
news:482B522A-5F84-4E25-B0FF-3570E612ADE6@microsoft.com...
> I'm having trouble sorting a Union Select query.  I would like to sort on
a hidden field, but from what I've read in help the only 'order by' field
that I can add has to be one that is selected in both queries that I'm
joining.
>
> Suggestions?
>
> Thanks for your help
>
>
>


Relevant Pages

  • Re: Load an array, sort it, write it to a text file
    ... Any reason why you can't use a UNION query to combine all 10 queries' ... results into one recordset, sort it, and then export it to a text file? ... > I want to load each line into an array, sort it, and then write it out to ...
    (microsoft.public.access.formscoding)
  • Re: Load an array, sort it, write it to a text file
    ... >I want to load each line into an array, sort it, and then write it out to the final file. ... Queries are tools designed to do exactly what you describe. ... you can create a UNION query in the SQL window. ... names in the first SELECT clause will be used. ...
    (microsoft.public.access.formscoding)
  • Re: Load an array, sort it, write it to a text file
    ... I've never used a UNION query. ... "Ken Snell" wrote: ... > results into one recordset, sort it, and then export it to a text file? ... >> I want to load each line into an array, sort it, and then write it out to ...
    (microsoft.public.access.formscoding)
  • Re: Secondary Sort for Union Query?
    ... Sort only the last one. ... I need the output of this Union Query to sort first by Field B, ... Tracker] AS WeekNumber ... ORDER BY Eligibles DESC, ...
    (microsoft.public.access.queries)
  • Re: Load an array, sort it, write it to a text file
    ... What were you going to do with the array if there ... >>>I want to load each line into an array, sort it, and then write it out ... >> Queries are tools designed to do exactly what you describe. ... >> For a bit more detail, you can create a UNION query in the SQL window. ...
    (microsoft.public.access.formscoding)