I'm trying to generate a report of people who are still running an old version of a client application. Our application logs all accesses via a Microsoft SQL Server 2000 table which looks like this (with additional columns for type of event reported, and specific messages)TABLE: dbo.reportusername | datestamp | version---------|----------------|--------- "tom" | 1/1/2009 8:00 | "v2.01.5" "jason" | 1/1/2009 12:00 | "v2.01.5" "steve" | 1/2/2009 12:00 | "v2.01.6" "steve" | 1/3/2009 12:00 | "v2.01.7" "jason" | 1/3/2009 13:00 | "v2.01.7" "tom" | 1/4/2009 11:00 | "v2.01.5" ... several million rows in the tableWe need to extract a list of people who have used the application with in a certain range of dates but have not run version v2.01.7I have tried:SELECT DISTINCT username FROM dbo.reportWHERE (datestamp > CONVERT(DATETIME, '2009-06-25 00:00:00', 102)) AND NOT EXISTS( SELECT DISTINCT username FROM dbo.report WHERE (version = 'v2.01.7') AND (datestamp > CONVERT(DATETIME, '2009-06-25 00:00:00', 102)) )ORDER BY username
This runs but doesn't return any results. If i run the 2 queries isolated, the main one returns 1285 rows. The inner one returns 881. The excluded list should contain 404 user names