Subquery

T

Té

I'm trying to create a subquery, but it is not working. The criteria I have
written in design view In(SELECT ProductID FROM tblProducts WHERE
CategoryID=TT) When I run the query I get a parameter value that pops up.
What am I doing wrong?
 
S

Stefan Hoffmann

hi Té,

Té said:
I'm trying to create a subquery, but it is not working. The criteria I have
written in design view In(SELECT ProductID FROM tblProducts WHERE
CategoryID=TT) When I run the query I get a parameter value that pops up.
What am I doing wrong?
You misspelled something in your query. You should post the entire SQL.

It should look like this:

SELECT *
FROM table O
WHERE O.field IN
(
SELECT I.ProductID
FROM tblProducts I
WHERE I.CategoryID = O.TT
)

Use table alias names.


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top