Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an SQL query with two SELECT statements and am using a UNION statement between those two to get a unique result. I need to use this query in Excel but I believe Excel does not accept a UNION statement.

What could be used instead of UNION in the query?

share|improve this question
add comment

1 Answer

This is an example query from a Microsoft KB article using the UNION statement.
Since that I would say: MS Query (Excel build-in tool for SQL querys) is capable to use UNION-Statements.

SELECT Color_Table.Join_Field, Color_Table.Color_Field,
   Pattern_Table.Pattern_Field
   FROM {oj `C:\database`.Pattern_Table LEFT OUTER JOIN
   `C:\database`.Color_Table ON Color_Table.Join_Field =
   Pattern_Table.Join_Field}
   UNION
   SELECT Color_Table.Join_Field, Color_Table.Color_Field,
   Pattern_Table.Pattern_Field
   FROM {oj `C:\database`.Color_Table LEFT OUTER JOIN
   `C:\database`.Pattern_Table ON Color_Table.Join_Field =
   Pattern_Table.Join_Field}
   WHERE (Color_Table.Color_Field Is Null)  or(Pattern_Table.Pattern_Field Is Null)

Source: http://support.microsoft.com/kb/136699/en-us

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.