Try the Below Query if you want only the records that have start date and end date as null for status other than that of CLSRM and all the records with CLSRM excepth those with null start date and end date
Select * from @tempTable where (status <> 'CLSRM' and strtdate is NULL and enddate is NULL) or (status = 'CLSRM' and strtdate is not NULL and enddate is not NULL)
the below query will give you the Records with status CLSRM without null values and the other rows with status not equal to CLSRM
Select * from @tempTable where (status <> 'CLSRM') or (status = 'CLSRM' and strtdate is not NULL and enddate is not NULL)
--------------------------------------------------------
Surender Singh Bhadauria
My Blog