Please tell me why this does not work:
SELECT t1.id FROM table1 t1 where t1.id not in (select t2.id from table2 t2 where t2.somedate between '2015-01-01 00:00:00' and '2015-04-30 23:59:59' ) group by t1.id The subquery works and the first select works but when I run the whole thing it comes up blank.
I am trying to find records (IDs) in one table that are not in another.
Any help would be much appreciated. This is on SQL Server btw.
Thanks
NULLs?