Help with unmatched query in SQL Server 2005
Posted on 2006-11-17
For years I've been using unmatched queries in Access (I have to admit to NEVER writing an unmatched query by hand - always used the Wizard) but now that I've moved my data to SQL Server I'm having a bit of a problem figuring out how to achieve the same results using stored procedures.
In one stored procedure, I return a set of all customers with the count of open orders:
SELECT fldCustID, COUNT(fldOrderID) AS OpenOrders
WHERE (fldCompleted = 0)
GROUP BY fldCustID
That part's easy. Now I need to compare this to my customers table:
WHERE (fldInactive = 0)
and find all customers in the second resultset that don't exist in the results of the first stored procedure.
I'm sure this is easy but it's got me stumped. Thanks in advance for your help!