954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Trouble with UNION

I'm making some sort of mistake in the following code:

use xPress_CR
select * 
from 
	(SELECT * 
 FROM dbo.T_JOBS 
 WHERE ENDDATEANDTIME = null
UNION
SELECT * 
 FROM dbo.T_JOBS 
 WHERE STATUS = 'Failed')


Any idea what I'm doing wrong?

P00dle
Junior Poster
154 posts since Nov 2009
Reputation Points: 10
Solved Threads: 1
 

no need to union

select * from dbo.T_JOBS where (STATUS = 'Failed' or ENDDATEANDTIME = NULL)
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

Thx, works now.

P00dle
Junior Poster
154 posts since Nov 2009
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: