Sephiroth0327
Registered User.
- Local time
- Today, 03:43
- Joined
- Aug 18, 2009
- Messages
- 19
Hi All,
Ok, my database is very simple. I am dealing with three tables:
The problem is that there may be multiple contracts associated with a project. Let's say my Projects table contains project "123456" and that project number is associated with 3 contracts. My resulting query displays three rows for 123456 when I really want one row with all three BarCode values in the BarCode field?
Here's what I am getting
Project # BarCode
123456 ABC 1234
123456 DEF 1234
123456 XYZ 1234
When what I want to see is
Project # BarCode
123456 ABC 1234; DEF 1234; XYZ 1234
Here is the SQL of my query
SELECT Projects.ProjectNum, ACT_Contract_Private.BarCodeList AS BarCode
FROM (Projects LEFT JOIN dbo_contract_project ON Projects.ProjectNum = dbo_contract_project.project_key) LEFT JOIN ACT_Contract_Private ON dbo_contract_project.contract_id = ACT_Contract_Private.ContractID;
Any ideas?
Ok, my database is very simple. I am dealing with three tables:
- Projects (contains a list of project numbers)
- dbo_contract_project (Table which contains basic contract information along with associated project number)
- ACT_Contract_Private (Table which contains additional contract information, most notably the BarCode field)
The problem is that there may be multiple contracts associated with a project. Let's say my Projects table contains project "123456" and that project number is associated with 3 contracts. My resulting query displays three rows for 123456 when I really want one row with all three BarCode values in the BarCode field?
Here's what I am getting
Project # BarCode
123456 ABC 1234
123456 DEF 1234
123456 XYZ 1234
When what I want to see is
Project # BarCode
123456 ABC 1234; DEF 1234; XYZ 1234
Here is the SQL of my query
SELECT Projects.ProjectNum, ACT_Contract_Private.BarCodeList AS BarCode
FROM (Projects LEFT JOIN dbo_contract_project ON Projects.ProjectNum = dbo_contract_project.project_key) LEFT JOIN ACT_Contract_Private ON dbo_contract_project.contract_id = ACT_Contract_Private.ContractID;
Any ideas?