A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Union Select sorting



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2004, 03:21 PM
JR
external usenet poster
 
Posts: n/a
Default Union Select sorting

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



  #2  
Old May 28th, 2004, 04:05 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default Union Select sorting

The Help file speaks the truth. The ORDER BY clause can
only relate to the columns output as it references the
column names assigned (either explicity or implicitly) in
the first part of the UNION. You will have to include your
hidden column if you wish to sort by it.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
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



.

  #3  
Old May 29th, 2004, 02:12 AM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default Union Select sorting

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" wrote in message
...
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





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.