[AccessD] Query fails when using NOT IN ???

David McAfee DMcAfee at haascnc.com
Wed Apr 21 15:13:26 CDT 2004


Pinnacle's SQL Server Professional, February 2002 (Volume 8, Number 2), 
"Known Problems with IN/NOT IN()"
 
This may only apply to SQL Server and not Access, but it has bit me in 
the a$$ before. The use of IN and NOT IN for a value list is still ok to 
use, but not for subqueries.
 
I too, used it many times in Access, but then again, I also used the MAX 
statement through the QBE window, assuming that I was using it 
correctly, only to find out as I started using QA that I had been 
writing Max Statements incorrectly...but I digress...:S
 
If you get your hands on that issue, also check out "The Rogue Delete":
 
BEGIN TRANSACTION T1
SELECT COUNT (*) FROM TitleAuthor
DELETE TitleAuthor WHERE au_id IN ( SELECT au_id FROM Publishers)
SELECT COUNT (*) FROM TitleAuthor
ROLLBACK T1
 
This deletes all rows in the TitleAuthor table, even though there is no 
au_id on the Publishers table :)
 
Christopher Hawkins wrote:
 
>A known issue?  No kidding.  I've been using the "IN (SELECT..."
>statement for years and have never had a problem.
>
>Do you know of any MSDN or similar documentation of this issue?
>
>-Christopher-



More information about the AccessD mailing list