Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error with Inner Joins

Status
Not open for further replies.

shauns1

Programmer
Oct 21, 2005
53
AU
Hi

Does anyone know why I'm getting the following error with the Query below?

Syntax Error (Missing Operator) in query expression 'e ON e.ThreadID=t.ThreadID
INNER JOIN tblUsers AS u ON u.UserID=t.CreatorID'

The query is:

SELECT t.ThreadID,t.Thread, t.CreationDate, count(e.EntryID),u.Username
FROM spPFApprovedThreads AS t
INNER JOIN spPFApprovedEntries AS e ON e.ThreadID=t.ThreadID
INNER JOIN tblUsers as u ON u.UserID = t.CreatorID
GROUP BY t.ThreadID,t.Thread,t.CreationDate, u.Username
ORDER BY t.ThreadID;

Thanks in advance

Shaun

 
SELECT t.ThreadID,t.Thread, t.CreationDate, count(e.EntryID),u.Username
FROM (spPFApprovedThreads AS t
INNER JOIN spPFApprovedEntries AS e ON e.ThreadID=t.ThreadID)
INNER JOIN tblUsers as u ON u.UserID = t.CreatorID
GROUP BY t.ThreadID,t.Thread,t.CreationDate, u.Username
ORDER BY t.ThreadID;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi

Yes, thank you. This has resolved the issue.

Shaun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top