ADO/ADO.NET - problem in order by using in select unoin query

Asked By mani on 27-Aug-12 07:04 AM
hi..i have problem in my select with union query in below select statement..

getting invalid column name dt error

Msg 207, Level 16, State 1, Line 2
Invalid column name 'dd'.
Msg 104, Level 16, State 1, Line 2
ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator.

select convert(datetime,date,103)as dd  from tbl_Newappraisal
union select convert(datetime,issuedate,103)as dd from silk_issue order by convert(datetime,dd,103) asc
Peter Bromberg replied to mani on 27-Aug-12 01:53 PM
Try using this 
select convert(datetime,date,103) 
in your order by statement, not the "dd" alias.