So I have a slight problem that I would really like to figure out.
Im kinda new to SQL so excuse the simplicity of my question.
I have 2 tables containing products and the other, dates relevent to the products.
TableOne:
-ID
-productID
-Product
TableTwo:
-ID
-productID
-dateOne
-dateTwo
-dateThree
I extract the data using a join WHERE TableOne.productID = TableTwo.productID AND displaying only the dates where its greater then current date()
The problem lies here.
Each product can have mulitple TableTwo.productID data\rows relating to one TableOne.productID.
I want to retrieve each TableOne.productID and all the data it relates to in TableTwo in one recordset.
This would be my ideal recordset
--------------------------------------------------------------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo|
--------------------------------------------------------------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo | TableTwo.dateOne | null | TableTwo.dateTwo|
--------------------------------------------------------------------------------------------------------------------------------------
| TableOne.productID(3) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo | null | TableTwo.dateTwo | TableTwo.dateTwo|
My current recordset contains this data
------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
So in plain english, I want each product returned containing all the dates that match each product.
Any tips or pointers would be great. Thanks for the help.
Jorge
Im kinda new to SQL so excuse the simplicity of my question.
I have 2 tables containing products and the other, dates relevent to the products.
TableOne:
-ID
-productID
-Product
TableTwo:
-ID
-productID
-dateOne
-dateTwo
-dateThree
I extract the data using a join WHERE TableOne.productID = TableTwo.productID AND displaying only the dates where its greater then current date()
The problem lies here.
Each product can have mulitple TableTwo.productID data\rows relating to one TableOne.productID.
I want to retrieve each TableOne.productID and all the data it relates to in TableTwo in one recordset.
This would be my ideal recordset
--------------------------------------------------------------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo|
--------------------------------------------------------------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo | TableTwo.dateOne | null | TableTwo.dateTwo|
--------------------------------------------------------------------------------------------------------------------------------------
| TableOne.productID(3) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo | null | TableTwo.dateTwo | TableTwo.dateTwo|
My current recordset contains this data
------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(1) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
------------------------------------------------------------------------------
| TableOne.productID(2) | TableTwo.dateOne | TableTwo.dateTwo | TableTwo.dateTwo |
So in plain english, I want each product returned containing all the dates that match each product.
Any tips or pointers would be great. Thanks for the help.
Jorge