I am having difficulty with a query. I found another post on the topic(titled Combine SubQuery and Left Join) Their solution worked perfectly, until i tried to add another subquery.
The issue arises when i add the below subquery. The subquery itself is fine, but i must not be adding it correctly into the rest of the query.
Any help you have your be greatly appreciated.
Thank you,
Chris
Code:
SELECT name.longname, a.SystemID, a.PDModifiedby, a.PD
FROM ([Copy of Table] AS a
LEFT JOIN [current log] AS log ON a.systemid=log.systemid)
LEFT JOIN (SELECT A2.customerID, LongName FROM [Copy Of Table] AS A2, GeneralInfo AS info WHERE A2.CustomerID=Info.CustomerID) AS name ON a.customerid=name.customerid
LEFT JOIN (SELECT systemid, max(OID) AS max_oid FROM [Copy Of Table] GROUP BY systemid) AS max_id on max_id.systemid=a.systemid
WHERE log.systemid Is Null
And a.systemid Is Not Null
And a.PDModifiedDate Between Forms![Reconciliation Report]!Start_date And Forms![Reconciliation Report]!End_date
And a.systemid In (300178,300059,300056)
GROUP BY name.longname, a.SystemID, a.PDModifiedby, a.PD;
The issue arises when i add the below subquery. The subquery itself is fine, but i must not be adding it correctly into the rest of the query.
Code:
LEFT JOIN (SELECT systemid, max(OID) AS max_oid FROM [Copy Of Table] GROUP BY systemid) AS max_id on max_id.systemid=a.systemid
Any help you have your be greatly appreciated.
Thank you,
Chris