Subquery

  • Thread starter Thread starter Té
  • Start date Start date
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?
 
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 <--
 
Back
Top