I am still a newbie in SQL Server and I need your help. I have a table with the following structure:
Each container could have 50 or more activity records with different dates. I need to be able to retrieve the container numbers that do not have activity between the dates 01/01/2011 and 12/31/2011. I tried the following script but doesn't work:
SELECT DISTINCT Container_no
WHERE NOT EXISTS (SELECT Container_no, Activity_Date
WHERE Activity_Date BETWEEN '01/01/2011' AND '12/31/2011')
ORDER BY Container_no
Any help would be very much appreciated.