AddyProg
AddyProg

Reputation: 3050

Left Join with two tables not Working

I am trying to join two two tables in MS ACCESS2010 query but it gives an error Here is the query

SELECT f.FileName, f.CreationDate, fs.SheetName, fs.SheetNo, SB.Tags
 FROM Files AS  f  LEFT JOIN FilesSheets AS  fs
ON f.FileId = fs.FileId
LEFT JOIN SubmitSheets AS  SB 
ON  f.FileId =SB.FileId
WHERE f.FileId = 'Machine_Inspection_20140820183554.xlsx'

Here is the error

enter image description here

Upvotes: 0

Views: 49

Answers (1)

Spevy
Spevy

Reputation: 1325

Access Needs Parenthesis around joins to group them. Try this:

SELECT f.FileName, f.CreationDate, fs.SheetName, fs.SheetNo, SB.Tags
FROM (Files f 
LEFT JOIN FilesSheets fs
ON f.FileId = fs.FileId)
LEFT JOIN SubmitSheets SB 
ON  f.FileId = SB.FileId
WHERE f.FileId = 'Machine_Inspection_20140820183554.xlsx'

Upvotes: 3

Related Questions