title: Access 2003 SQL Syntax error in join message
body: <p>I am new at coding in SQL for access 2003 and I am having a problem showing a additional column called Action which is shown on the tLEDGERS table. I am recieving a syntax error message but I am not sure why?</p>
  
  <p><strong>Below is the code snippet causing the issue</strong></p>
  
  <p>FROM (tDailyEntries
  INNER JOIN tDailyEntries
  ON tLEDGERS.Action = tDailyEntries.ActionNo)</p>
  
  <p><strong>Below is the full code</strong></p>
  
  <pre><code>SELECT DISTINCT tProjects.CC_IO AS ProjectNo,
  Year([DateFrom]) &amp; " Accrual " &amp; MonthName(Month([DateFrom])) &amp; " - "+[CompanyName] &amp; " ( "+([LastName]) &amp; ")" AS [Line/Item/Text],
  tUsers.LastName AS Last_Name, 
  tDailyEntries.UserId AS UserID, 
  contractordailyrate AS DailyRate, 
  contractordailyhours AS Hours, 
  ROUND(contractordailyrate / contractordailyhours, 2) AS HourlyRate,
  ROUND(SUM(tDailyEntries.CalculatedDailyHours), 2) AS MonthlyHours, 
  ROUND((HourlyRate * MonthlyHours), 2) AS Charge, 
  ROUND(Charge+ROUND((Charge*0.2),2),2) AS Accruals, tProjects.Project AS Project
  FROM (tDailyEntries
  INNER JOIN tDailyEntries
  ON tLEDGERS.Action = tDailyEntries.ActionNo)
  FROM (tProjectType 
  RIGHT JOIN tProjects ON tProjectType.ProjectTypeID = tProjects.ProjectTypeID) 
  RIGHT JOIN (textcontractor 
  RIGHT JOIN (tTitle 
  RIGHT JOIN (((tLocation 
  RIGHT JOIN (tDepartments 
  RIGHT JOIN tUsers 
  ON tDepartments.DeptID = tUsers.DeptID) 
  ON tLocation.LocationID = tUsers.LocationID) 
  RIGHT JOIN (((tDailyEntries 
  LEFT JOIN tDepartments AS tDepartments_1 
  ON tDailyEntries.DeptCharged = tDepartments_1.DeptShortName) 
  LEFT JOIN tActions ON tDailyEntries.ActionNo = tActions.ActionID) 
  LEFT JOIN tLookups 
  ON tDailyEntries.Zone = tLookups.LookupID) 
  ON tUsers.UserID = tDailyEntries.UserID) 
  LEFT JOIN textmain 
  ON tUsers.UserID = textmain.userID) 
  ON tTitle.TitleID = tUsers.TitleID) 
  ON textcontractor.companyid = textmain.contractorcompany) 
  ON tProjects.ProjectID = tDailyEntries.ProjectNo
  WHERE tTitle.TitleID = 37 
  AND Month([DateFrom]) = MonthNum 
  AND Day([DateFrom]) &lt;21
  GROUP BY tProjects.CC_IO, Year([DateFrom]) &amp; " Accrual " &amp; MonthName(Month([DateFrom])) &amp; " - "+[CompanyName] &amp; " ( "+([LastName]) &amp; ")", tUsers.LastName, tDailyEntries.UserId, textmain.contractordailyrate, 
  Month([DateFrom]), textmain.contractordailyhours, tProjects.Project;
  </code></pre>
  
  <p>Please see my updated code below</p>
  
  <pre><code>SELECT DISTINCT tProjects.CC_IO AS ProjectNo,
  Year([DateFrom]) &amp; " Accrual " &amp; MonthName(Month([DateFrom])) &amp; " - "+[CompanyName] &amp; " ( "+([LastName]) &amp; ")" AS [Line/Item/Text],
  tUsers.LastName AS Last_Name, 
  tDailyEntries.UserId AS UserID, 
  contractordailyrate AS DailyRate, 
  contractordailyhours AS Hours, 
  ROUND(contractordailyrate / contractordailyhours, 2) AS HourlyRate,
  ROUND(SUM(tDailyEntries.CalculatedDailyHours), 2) AS MonthlyHours, 
  ROUND((HourlyRate * MonthlyHours), 2) AS Charge, 
  ROUND(Charge+ROUND((Charge*0.2),2),2) AS Accruals, tProjects.Project AS Project
  FROM (tDailyEntries INNER JOIN tLEDGERS 
  ON tLEDGERS.Action = tDailyEntries.ActionNo)
  FROM (tProjectType 
  RIGHT JOIN tProjects ON tProjectType.ProjectTypeID = tProjects.ProjectTypeID) 
  RIGHT JOIN (textcontractor 
  RIGHT JOIN (tTitle 
  RIGHT JOIN (((tLocation 
  RIGHT JOIN (tDepartments 
  RIGHT JOIN tUsers 
  ON tDepartments.DeptID = tUsers.DeptID) 
  ON tLocation.LocationID = tUsers.LocationID) 
  RIGHT JOIN (((tDailyEntries 
  LEFT JOIN tDepartments AS tDepartments_1 
  ON tDailyEntries.DeptCharged = tDepartments_1.DeptShortName) 
  LEFT JOIN tActions ON tDailyEntries.ActionNo = tActions.ActionID) 
  LEFT JOIN tLookups 
  ON tDailyEntries.Zone = tLookups.LookupID) 
  ON tUsers.UserID = tDailyEntries.UserID) 
  LEFT JOIN textmain 
  ON tUsers.UserID = textmain.userID) 
  ON tTitle.TitleID = tUsers.TitleID) 
  ON textcontractor.companyid = textmain.contractorcompany) 
  ON tProjects.ProjectID = tDailyEntries.ProjectNo
  WHERE tTitle.TitleID = 37 
  AND Month([DateFrom]) = MonthNum 
  AND Day([DateFrom]) &lt;21
  GROUP BY tProjects.CC_IO, Year([DateFrom]) &amp; " Accrual " &amp; MonthName(Month([DateFrom])) &amp; " - "+[CompanyName] &amp; " ( "+([LastName]) &amp; ")", tUsers.LastName, tDailyEntries.UserId, textmain.contractordailyrate, 
  Month([DateFrom]), textmain.contractordailyhours, tProjects.Project;
  </code></pre>
  
  <p>updated code 2</p>
  
  <pre><code>SELECT DISTINCT tProjects.CC_IO AS ProjectNo,
  Year([DateFrom]) &amp; " Accrual " &amp; MonthName(Month([DateFrom])) &amp; " - "+[CompanyName] &amp; " ( "+([LastName]) &amp; ")" AS [Line/Item/Text],
  tUsers.LastName AS Last_Name, 
  tDailyEntries.UserId AS UserID, 
  contractordailyrate AS DailyRate, 
  contractordailyhours AS Hours, 
  ROUND(contractordailyrate / contractordailyhours, 2) AS HourlyRate,
  ROUND(SUM(tDailyEntries.CalculatedDailyHours), 2) AS MonthlyHours, 
  ROUND((HourlyRate * MonthlyHours), 2) AS Charge, 
  ROUND(Charge+ROUND((Charge*0.2),2),2) AS Accruals, tProjects.Project AS Project
  FROM (tDailyEntries
  INNER JOIN tLEDGERS ON tLEDGERS.Action = tDailyEntries.ActionNo)
  INNER JOIN (tProjects ON tProjectType.ProjectTypeID = tProjects.ProjectTypeID
  RIGHT JOIN (textcontractor 
  RIGHT JOIN (tTitle 
  RIGHT JOIN (((tLocation 
  RIGHT JOIN (tDepartments 
  RIGHT JOIN tUsers 
  ON tDepartments.DeptID = tUsers.DeptID) 
  ON tLocation.LocationID = tUsers.LocationID) 
  RIGHT JOIN (((tDailyEntries 
  LEFT JOIN tDepartments AS tDepartments_1 
  ON tDailyEntries.DeptCharged = tDepartments_1.DeptShortName) 
  LEFT JOIN tActions ON tDailyEntries.ActionNo = tActions.ActionID) 
  LEFT JOIN tLookups 
  ON tDailyEntries.Zone = tLookups.LookupID) 
  ON tUsers.UserID = tDailyEntries.UserID) 
  LEFT JOIN textmain 
  ON tUsers.UserID = textmain.userID) 
  ON tTitle.TitleID = tUsers.TitleID) 
  ON textcontractor.companyid = textmain.contractorcompany) 
  ON tProjects.ProjectID = tDailyEntries.ProjectNo
  WHERE tTitle.TitleID = 37 
  AND Month([DateFrom]) = MonthNum 
  AND Day([DateFrom]) &lt;21
  GROUP BY tProjects.CC_IO, Year([DateFrom]) &amp; " Accrual " &amp; MonthName(Month([DateFrom])) &amp; " - "+[CompanyName] &amp; " ( "+([LastName]) &amp; ")", tUsers.LastName, tDailyEntries.UserId, textmain.contractordailyrate, 
  Month([DateFrom]), textmain.contractordailyhours, tProjects.Project;
  </code></pre>