Question : ORDER BY in UNION query that contains both text and numbers

I use this sql statement to generate the dropdown list in a combo box.

SELECT DISTINCT RDCNum FROM tblFinalOutput INNER JOIN valRDCNum ON tblFinalOutput.RDCNumber = valRDCNum.RDCIndex UNION SELECT "" FROM tblFinalOutput
ORDER BY RDCNum

With or without the ORDER BY RDCNum I get the following list in my combo box...


1419
955
962

I would prefer this...


955
962
1419

Presumably, the UNION of a Text field and a Number field creates a new Text field and since 1 comes before 9 in a text string, 1419 is listed before 955. Is there any way to work around this?

Answer : ORDER BY in UNION query that contains both text and numbers

This will do that with what looks like an additional space in front of all the values:
   SELECT DISTINCT chr(160) & Format([RDCNum],"@@@@") ...
and
   UNION SELECT   " " FROM Reminders
and you might need to change the Order by line to :
   ORDER BY 1

That's ORDER BY column 1, in case you did it know you can do that. Character 160 is a hard space.
Random Solutions  
 
programming4us programming4us