T
ToDieFor
I need help with a small database (less than 500 lines / table) that I'm
working on. I have a parts list that I'm breaking down by manufacturer,
seller, model number, new / old number, etc. I need to have a query pull in
all the information based on old number, some of the old numbers will not
have new numbers, will not have manufacturer, will not have a brand name,
etc, but I still want all of the old numbers to come in, and a <NULL> value
assigned to the fields that are not relavent. I was trying to accomplish this
with the use of left and right outer joins, but for some reason when I put it
all together, I get an error about the order of the join and for some reason
can't seem to figure out what's wrong. I have tried using other queries to
pull in some of the data and piece it together and it still only returns 139
records, where I am guessing it should be closer to 300 if working correctly.
Tables I have are
[OldPartNumber]
-----
OldPartID
ModelNo
[ModelNumber]
-----
ModelID
ModelName
ModelReplaced
ProductType
Dimensions
[NewPartNumber]
----
NewPartID
OldPartID
[SKUs]
----
SKUID
BrandID
[BrandName]
-----
BrandID
BrandName
IsRelavent
[ProductTypes]
-----
ProductTypeID
ProductTypeName
[XRef]
SKUID
OldPartID
[NewXRef]
NewPartID
OldPartID
.....
What I want to do is join the data so that I can bring in Model Name, Model
Replaced, Model Dimensions, Product Type Name, Brand Name, SKU#, and New
Number.
This returns 110 records, I modded it slightly by using 2 different queries
for the XRef links, but that returned only 139 lines. I don't have the
modification any more because when it failed I removed the query.
Thanks for your help.
working on. I have a parts list that I'm breaking down by manufacturer,
seller, model number, new / old number, etc. I need to have a query pull in
all the information based on old number, some of the old numbers will not
have new numbers, will not have manufacturer, will not have a brand name,
etc, but I still want all of the old numbers to come in, and a <NULL> value
assigned to the fields that are not relavent. I was trying to accomplish this
with the use of left and right outer joins, but for some reason when I put it
all together, I get an error about the order of the join and for some reason
can't seem to figure out what's wrong. I have tried using other queries to
pull in some of the data and piece it together and it still only returns 139
records, where I am guessing it should be closer to 300 if working correctly.
Tables I have are
[OldPartNumber]
-----
OldPartID
ModelNo
[ModelNumber]
-----
ModelID
ModelName
ModelReplaced
ProductType
Dimensions
[NewPartNumber]
----
NewPartID
OldPartID
[SKUs]
----
SKUID
BrandID
[BrandName]
-----
BrandID
BrandName
IsRelavent
[ProductTypes]
-----
ProductTypeID
ProductTypeName
[XRef]
SKUID
OldPartID
[NewXRef]
NewPartID
OldPartID
.....
What I want to do is join the data so that I can bring in Model Name, Model
Replaced, Model Dimensions, Product Type Name, Brand Name, SKU#, and New
Number.
Code:
SELECT ProductLines.ProdcutLineName, BrandName.BrandName, XRef.SKUNo,
XRef.OldPartID, NewPartNumber.NewPartID, ModelNumbers.ModelName,
ModelNumbers.ModelReplaced, ModelNumbers.Dimensions
FROM ((BrandName INNER JOIN SKUs ON BrandName.BrandNameID = SKUs.BrandID)
INNER JOIN (ProductLines INNER JOIN (ModelNumbers INNER JOIN (OldPartNumber
INNER JOIN XRef ON OldPartNumber.OldPartID = XRef.OldPartID) ON
ModelNumbers.ModelID = OldPartNumber.OldPartName) ON
ProductLines.ProductLineID = ModelNumbers.ProductLineID) ON SKUs.SKUNo =
XRef.SKUNo) INNER JOIN NBXRef ON OldPartNumber.OldPartID = NewXRef.OldPartID
ORDER BY ProductLines.ProdcutLineName, XRef.SKUNo;
This returns 110 records, I modded it slightly by using 2 different queries
for the XRef links, but that returned only 139 lines. I don't have the
modification any more because when it failed I removed the query.
Thanks for your help.