csiwa28
Programmer
- Apr 12, 2001
- 177
I am trying to join 3 tables and extract particular data from the new table created and I am having trouble.My three tables are:
1. Catalogs
Catalog_ID
Catalog_ProductID
Catalog_Reference
Catalog_Month
Catalog_Year
Catalog_CatalogTypeID
2. ProductModels
ProductModel_ProductID
ProductModel_Model
3. CatalogTypes
CatalogType_ID
CatalogType_Description
I am trying to first join the Catalog Table with the CatalogTypes Table by CatalogTypeID then join that with the ProductModels table by the ProductID.
"SELECT Catalogs.Catalog_Reference,Catalogs.Catalog_Month, Catalogs.Catalog_Year, ProductModels.ProductModel_Model, CatalogTypes.CatalogType_Description FROM ProductModels INNER JOIN (Catalogs INNER JOIN CatalogTypes ON Catalogs.Catalog_CatalogTypeID=CatalogTypes.CatalogType_ID) ON Catalogs.Catalog_ProductID=ProductModels.ProductModel_ProductID WHERE ProductModels.ProductModel_ProductID=" & Request.QueryString("ID"
It seems to work when take out the 'WHERE' part but when I leave it in, my page is left blank. What am I doing wrong?
1. Catalogs
Catalog_ID
Catalog_ProductID
Catalog_Reference
Catalog_Month
Catalog_Year
Catalog_CatalogTypeID
2. ProductModels
ProductModel_ProductID
ProductModel_Model
3. CatalogTypes
CatalogType_ID
CatalogType_Description
I am trying to first join the Catalog Table with the CatalogTypes Table by CatalogTypeID then join that with the ProductModels table by the ProductID.
"SELECT Catalogs.Catalog_Reference,Catalogs.Catalog_Month, Catalogs.Catalog_Year, ProductModels.ProductModel_Model, CatalogTypes.CatalogType_Description FROM ProductModels INNER JOIN (Catalogs INNER JOIN CatalogTypes ON Catalogs.Catalog_CatalogTypeID=CatalogTypes.CatalogType_ID) ON Catalogs.Catalog_ProductID=ProductModels.ProductModel_ProductID WHERE ProductModels.ProductModel_ProductID=" & Request.QueryString("ID"
It seems to work when take out the 'WHERE' part but when I leave it in, my page is left blank. What am I doing wrong?