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!

Multiple left join error on CR10 1

Status
Not open for further replies.

anglophobe

Technical User
Nov 27, 2006
11
CA
When I attempt to join three tables through left joins, I'm getting a syntax error of:
Query Engine Error: 'DAO Error Code: 0xc03
Source: DAO.Database
Description: Syntax error (missing operator) in query expression 'dbo_Incident.RecID = dbo_AuditHistory.ParentLink_RecID

LEFT JOIN dbo_Profile
ON dbo_Profile.LoginID = dbo_Incident.Owner'.'

I am adding in SQL to the command section of the Database expert.
The SQL command I am attempting to use is this:
Code:
SELECT dbo_Incident.RecID, dbo_Incident.IncidentNumber, dbo_Incident.Status, dbo_Incident.CreatedDateTime, dbo_AuditHistory.CreatedDateTime, dbo_AuditHistory.Fieldname, dbo_AuditHistory.OldFieldValue, dbo_AuditHistory.NewFieldValue, dbo_Incident.Service, dbo_Incident.LastModDateTime, dbo_Incident.Owner, dbo_Profile.Team

FROM dbo_Incident

LEFT JOIN dbo_AuditHistory
ON dbo_Incident.RecID = dbo_AuditHistory.ParentLink_RecID

LEFT JOIN dbo.Profile
ON dbo_Profile.LoginID = dbo_Incident.Owner
If you take out the second LEFT JOIN and the dbo_Profile.Team, it works fine, or if you take out the first join and it's related fields, it works fine.
I'm using Crystal Reports 10.
 
I think you need parens as noted below (actually the last paren is optional I think, but then you would have to remove the corresponding opening paren:

SELECT dbo_Incident.RecID, dbo_Incident.IncidentNumber, dbo_Incident.Status, dbo_Incident.CreatedDateTime, dbo_AuditHistory.CreatedDateTime, dbo_AuditHistory.Fieldname, dbo_AuditHistory.OldFieldValue, dbo_AuditHistory.NewFieldValue, dbo_Incident.Service, dbo_Incident.LastModDateTime, dbo_Incident.Owner, dbo_Profile.Team

FROM ((dbo_Incident

LEFT JOIN dbo_AuditHistory
ON dbo_Incident.RecID = dbo_AuditHistory.ParentLink_RecID)

LEFT JOIN dbo.Profile
ON dbo_Profile.LoginID = dbo_Incident.Owner )

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top