How to repair "order by" after union of 2 selects from 1 tables

Posted by 4e4el on Stack Overflow See other posts from Stack Overflow or by 4e4el
Published on 2010-06-13T16:42:20Z Indexed on 2010/06/13 16:52 UTC
Read the original article Hit count: 167

Filed under:
|

I have a dropDownList on my form, where i need to have union of values from 2 colums of table [ost].

Type of this columns is currency. I have russian version of access, default value of curency in "rur" and i need "uah". I need to change format and save "order by".

I use this query:

(SELECT distinct FORMAT([Sum1] ,'# ##0.00" uah.";-# ##0.00" uah."') FROM ost) 
Union 
(SELECT distinct FORMAT([Sum2],'# ##0.00" uah.";-# ##0.00" uah."') FROM ost)
ORDER BY 1

© Stack Overflow or respective owner

Related posts about sql

Related posts about access