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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finishing SQL Query using OR operator 1

Status
Not open for further replies.

aonefun

Technical User
May 21, 2007
79
US
Here is the first portion of my query which works fine:

SELECT ManufacturerPartNumber, ProductFamily FROM Products WHERE ManufacturerPartNumber = Request.Form("ManufacturerPartNumber")

However, I need to add an OR operator to include additional ManufacturerPartNumbers that share a common ProductFamily as the ManufacturerPartNumber that matches exactly to the Request.Form

>How do I complete the query to accomplish this?
 
Something like this ?
SELECT ManufacturerPartNumber, ProductFamily
FROM Products
WHERE ProductFamily In (
SELECT ProductFamily FROM Products
WHERE ManufacturerPartNumber = Request.Form("ManufacturerPartNumber")
)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
This seems right. I'm not sure why it's not working though. I'm wondering if this is because I'm setting a session variable to equal Recordset1.Fields.Item("ManufacturerPartNumber").Value

This is not SQL, wondering if you might know if a session variable can contain more than one value as can a recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top