[AccessD] Sorting combo based on Union query

Neal Kling nkling at co.montgomery.ny.us
Tue Feb 15 09:52:14 CST 2005


Yes, that would work also. And, if I didn't have the two column trick I think it would look cleaner than putting a space in front of the "All".

Neal

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Susan Harkins
Sent: Tuesday, February 15, 2005 10:48 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Sorting combo based on Union query


?Asc("1")
 49 
?Asc(1)
 49 
?Asc("(")
 40 


The Ascii character for the ( is smaller than the character for 1 -- have
you tried enclosing All in ()'s? 

Susan H. 

I'm adding an "All" selection to a combo box using a union query more or
less like this:

SELECT "All" as snoot from MyTable UNION SELECT MyTable.Field FROM MyTable;

MyTable.Field is defined as Text but contains Integer values.

Naturally the ascending sort order puts the numbers first. The "All" comes
at the end of the list, and I want it at the top. I have tried adding an
ORDER BY clause and by using DESC the "All" is at the top, but of course the
numbers are then in reverse order. I have also swapped the order of the
select statements but that makes no difference.

So, does anyone have a suggestion as to how I can get "All" at the top of
the list with the rest of the list in numeric order?

Thanks,
Neal
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list