csiwa28
Programmer
- Apr 12, 2001
- 177
I have 2 tables - Products and Company
In Products I have the following fields and info.
ProductID CompanyID ProductTypeID
1 200 100
2 201 101
3 202 100
In Company I have...
CompanyID CompanyName
200 ABC corporation
My question is that I want to be able to display certain companies by a particular ProductTypeID, but instead of showing the CompanyID, I need to show the CompanyName.
SQL_query = "SELECT Products.CompanyID, Company.CompanyName FROM Products INNER JOIN Company ON Products.CompanyID = Company.CompanyID WHERE Products.ProductTypeID = 100"
I am able to display all the companies that have ProductTypeID = 100, but they are all displayed as their ID number and not their name. How can I fix this?
In Products I have the following fields and info.
ProductID CompanyID ProductTypeID
1 200 100
2 201 101
3 202 100
In Company I have...
CompanyID CompanyName
200 ABC corporation
My question is that I want to be able to display certain companies by a particular ProductTypeID, but instead of showing the CompanyID, I need to show the CompanyName.
SQL_query = "SELECT Products.CompanyID, Company.CompanyName FROM Products INNER JOIN Company ON Products.CompanyID = Company.CompanyID WHERE Products.ProductTypeID = 100"
I am able to display all the companies that have ProductTypeID = 100, but they are all displayed as their ID number and not their name. How can I fix this?