• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOIN with three tables ?

 
jite eghagha
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to harvest data from three tables. The statment below joins two of my tables as desired(tblproject and tbltask).

SELECT tblproject.ProjectNumber,tblproject.Title,tbltask.Title
FROM tblproject
LEFT OUTER JOIN tbltask
ON tblproject.ProjectID = tbltask.ProjectID;

Would someone show me how to join the last table (tblcostcenter) the statment below may give you a rough idea of what i lack.

SELECT tblproject.ProjectNumber,tblproject.Title,tbltask.Title,tblcostcenter.Name
FROM .......
LEFT OUTER JOIN ........
ON tblproject.ProjectID = tbltask.ProjectID;
ON tblproject.costCenterID = tblcostcenter.costcenterID
[ November 20, 2006: Message edited by: jite eghagha ]
 
jite eghagha
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it!

SELECT tblproject.ProjectNumber,tblproject.Title,tbltask.Title,tblcostcenter.Name
FROM tblproject
LEFT OUTER JOIN tbltask
ON tblproject.ProjectID = tbltask.ProjectID
LEFT OUTER JOIN tblcostcenter
ON tblproject.CostCenterID = tblcostcenter.CostCenterID;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic