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?

no need to union

select * from dbo.T_JOBS where (STATUS = 'Failed' or ENDDATEANDTIME = NULL)

Thx, works now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.