Simply this is enough
Select * from @tempTable WHERE (Strtdate is not null and enddate is not null) or status <> 'CLRSM'
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs