All,
I am having a query problem. The query will pull from a form where the user input dates. Below is the date part of the where statement
Code:
and RA.PDModifiedDate >="#" & Format(Forms![Reconciliation Report]!Start_date,"mm\/dd\/yyyy") & "#"
And RA.PDModifiedDate <="#" & Format(Forms![Reconciliation Report]!End_date,"mm\/dd\/yyyy") & "#"
This code has worked correctly in previous query. The one i'm using it in now is much more complex.
Code:
SELECT a.SystemID, a.PD, a.oid, b.[proposed pd grade]
FROM FAMAS_bbvaAuditLog AS RA, [Current Log] AS Log, (select systemid, max (OID) as max_oid
from[FAMAS_bbvaauditlog]
group by systemid) AS max_id
WHERE a.systemid = b.systemid
and max_id.systemid = a.systemid
and max_id.max_oid = a.oid
and a.PD IN ("CCC+", "CCC", "CCC-", "CC+", "CC", "CC-", "D1", "D2")
and a.PDStatus = "Approved"
and (a.FacilityStatus = "Booked" OR a.FacilityStatus = "Booked-Pending" OR a.FacilityStatus = "Approved")
and a.LGD is not null
and a.pd <> b.[proposed pd grade]
and a.PDModifiedDate >="#" & Format(Forms![Reconciliation Report]!Start_date,"mm\/dd\/yyyy") & "#"
And a.PDModifiedDate <="#" & Format(Forms![Reconciliation Report]!End_date,"mm\/dd\/yyyy") & "#"
GROUP BY a.SystemID, a.PD, a.oid, b.[proposed pd grade];
It works perfectly, before i add the date range code.
Your assistance is greatly appreciated.
Chris