How to get the data from sql table where data is not present in the between dates
I am using three table
- Customer Master
- Daily dispatch
- EmptyCylinderRecd
I want to find the customers who are not in the Dailydispatch
and EmptyCylinderRecd
tables. I have tried this query but the expected results are not showing up:
select *
from CustomerMaster
where
not EXISTS (select *
from DailyDispatch
where OrderDate between '1/22/2014' and '08/10/2014') or
not exists (select *
from EmptyCylinderRecd
where Date between '1/22/2014' and '08/10/2014')