Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select

Status
Not open for further replies.

sturner333

Programmer
Jan 19, 2004
67
0
0
US
Why would I get a statement for the sql criteria in a query that reads "At most one record can be returner from this subquery"

((select[tblPlatformCategories].[platformid] from [tblPlatformCategories] where
[tblPlatformCategories].[platformid] <>
[qry1].[platformid])[tblPlatformCategories].[platformid] from [tblPlatformCategories] where
[tblPlatformCategories].[platformid] <>
[qry1].[platformid])


I just want to filter out the records from tblPlatformCategories that have
the same platfronId as qry1.
Thanks
 
Why not a Left Join between Qry1 and tblPlatformCategories?
 
If I understand correctly, the following should work.
Code:
 select platformid
 from tblPlatformCategories
 where platformid NOT IN (SELECT platformid FROM qry1)

Duane
Hook'D on Access
MS Access MVP
 
I get the same result with NOT IN as above. Any other ideas?
 
Wouldn't a JOIN be quicker?

SELECT tblPlatformCategories.platformid
FROM tblPlatformCategories
LEFT JOIN qry1
ON tblPlatformCategories.platformid=qry1.platformid
WHERE qry1.platformid Is Null
 
The SQL I provided would not generate the error message you stated. It might help to know the SQL of qry1.

I would think Remou's solution would work just as well.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top