D
DawnTreader
Hello All
i have need to make this work:
SELECT
tblProductList.ProductID AS ProdID,
"CBA" AS Category,
tblCBAPartList.IMWPartNumberID AS IMWPNID,
dbo_PART.DESCRIPTION AS PartDesc,
"CBA" AS Ref,
tblCBAPartList.QTY AS PartBlockQTY,
dbo_PART.UNIT_PRICE AS ListPrice,
tblCBAPartList.CBAPartListID AS PLID
FROM
(tblCBBANumbers RIGHT JOIN ((tblProductList LEFT JOIN
[SELECT ALL
tblProductPartList.ProductID AS ProdID,
tblProductPartList.RequirementCategory AS Category,
dbo_REQUIREMENT.PART_ID AS IMWPNID,
dbo_PART.DESCRIPTION AS PartDesc,
dbo_REQUIREMENT.REFERENCE AS Ref,
dbo_REQUIREMENT.QTY_PER AS PartBlockQTY,
dbo_PART.UNIT_PRICE AS ListPrice,
tblProductPartList.PartListID AS PLID
FROM
(tblProductPartList LEFT JOIN dbo_REQUIREMENT ON
tblProductPartList.RequirementID = dbo_REQUIREMENT.ROWID)
LEFT JOIN dbo_PART ON dbo_REQUIREMENT.PART_ID = dbo_PART.ID
WHERE
(((tblProductPartList.RequirementID) Is Not Null) AND
tblProductPartList.ProductID=669)
UNION SELECT ALL
tblProductPartList.ProductID AS ProdID,
subtblSectionName.SectionName AS Category,
tblProductPartList.IMWPartNumberID AS IMWPNID,
dbo_PART.DESCRIPTION AS PartDesc,
"Manual" AS Ref,
tblProductPartList.QTY AS PartBlockQTY,
dbo_PART.UNIT_PRICE AS ListPrice,
tblProductPartList.PartListID AS PLID
FROM
subtblSectionName INNER JOIN (tblProductPartList LEFT JOIN
dbo_PART ON tblProductPartList.IMWPartNumberID = dbo_PART.ID)
ON subtblSectionName.SectionNameID =
tblProductPartList.SectionNameID
WHERE (((tblProductPartList.IMWPartNumberID) Is Not Null) AND
tblProductPartList.ProductID=669)]. AS SQ1
ON tblProductList.ProductID = SQ1.ProdID) LEFT JOIN subdatatblCompressor
ON (tblProductList.ProductTypeID = subdatatblCompressor.ProductTypeID)
AND (tblProductList.ProductID = subdatatblCompressor.ProductID)) ON
tblCBBANumbers.CBBAID = subdatatblCompressor.CBAEMID)
LEFT JOIN (tblCBAPartList LEFT JOIN dbo_PART ON
tblCBAPartList.IMWPartNumberID = dbo_PART.ID) ON tblCBBANumbers.CBBAID =
tblCBAPartList.CBAID
WHERE
(((tblProductList.ProductID)=669) AND ((SQ1.IMWPNID) Is Null));
the subquery should show everything, and the main query should only show
what is not already in the subquery. i used another union query i made as the
basis for this, but this one isnt working. any suggestions?
i know it has to do with the SQ1.IMWPNID is null line, but i am unsure of
what to change it to, or if the query needs to be restructured, ie i have the
wrong dataset being the subquery.
any and all help appreciated.
i have need to make this work:
SELECT
tblProductList.ProductID AS ProdID,
"CBA" AS Category,
tblCBAPartList.IMWPartNumberID AS IMWPNID,
dbo_PART.DESCRIPTION AS PartDesc,
"CBA" AS Ref,
tblCBAPartList.QTY AS PartBlockQTY,
dbo_PART.UNIT_PRICE AS ListPrice,
tblCBAPartList.CBAPartListID AS PLID
FROM
(tblCBBANumbers RIGHT JOIN ((tblProductList LEFT JOIN
[SELECT ALL
tblProductPartList.ProductID AS ProdID,
tblProductPartList.RequirementCategory AS Category,
dbo_REQUIREMENT.PART_ID AS IMWPNID,
dbo_PART.DESCRIPTION AS PartDesc,
dbo_REQUIREMENT.REFERENCE AS Ref,
dbo_REQUIREMENT.QTY_PER AS PartBlockQTY,
dbo_PART.UNIT_PRICE AS ListPrice,
tblProductPartList.PartListID AS PLID
FROM
(tblProductPartList LEFT JOIN dbo_REQUIREMENT ON
tblProductPartList.RequirementID = dbo_REQUIREMENT.ROWID)
LEFT JOIN dbo_PART ON dbo_REQUIREMENT.PART_ID = dbo_PART.ID
WHERE
(((tblProductPartList.RequirementID) Is Not Null) AND
tblProductPartList.ProductID=669)
UNION SELECT ALL
tblProductPartList.ProductID AS ProdID,
subtblSectionName.SectionName AS Category,
tblProductPartList.IMWPartNumberID AS IMWPNID,
dbo_PART.DESCRIPTION AS PartDesc,
"Manual" AS Ref,
tblProductPartList.QTY AS PartBlockQTY,
dbo_PART.UNIT_PRICE AS ListPrice,
tblProductPartList.PartListID AS PLID
FROM
subtblSectionName INNER JOIN (tblProductPartList LEFT JOIN
dbo_PART ON tblProductPartList.IMWPartNumberID = dbo_PART.ID)
ON subtblSectionName.SectionNameID =
tblProductPartList.SectionNameID
WHERE (((tblProductPartList.IMWPartNumberID) Is Not Null) AND
tblProductPartList.ProductID=669)]. AS SQ1
ON tblProductList.ProductID = SQ1.ProdID) LEFT JOIN subdatatblCompressor
ON (tblProductList.ProductTypeID = subdatatblCompressor.ProductTypeID)
AND (tblProductList.ProductID = subdatatblCompressor.ProductID)) ON
tblCBBANumbers.CBBAID = subdatatblCompressor.CBAEMID)
LEFT JOIN (tblCBAPartList LEFT JOIN dbo_PART ON
tblCBAPartList.IMWPartNumberID = dbo_PART.ID) ON tblCBBANumbers.CBBAID =
tblCBAPartList.CBAID
WHERE
(((tblProductList.ProductID)=669) AND ((SQ1.IMWPNID) Is Null));
the subquery should show everything, and the main query should only show
what is not already in the subquery. i used another union query i made as the
basis for this, but this one isnt working. any suggestions?
i know it has to do with the SQ1.IMWPNID is null line, but i am unsure of
what to change it to, or if the query needs to be restructured, ie i have the
wrong dataset being the subquery.
any and all help appreciated.