As posted you are missing a comparison operator in the second condition.
Why not the following.
SELECT tblPatientProtocolActivity.D1Tx, tblPatientProtocolActivity.[ICF
date], tblPatientProtocolActivity.ScreeningDate, tblPatients.LastName,
tblPatients.FirstName, tblPatients.MRN, tblPatientProtocolActivity.Prot_ID,
tblPatientProtocolActivity.PtStatusID, tblPatients.MDID,
tblPatientProtocolActivity.Comments
FROM tblPatients INNER JOIN tblPatientProtocolActivity ON
tblPatients.PtID =
tblPatientProtocolActivity.PtID
WHERE tblPatientProtocolActivity.ScreeningDate>=Date() Or
tblPatientProtocolActivity.[ICF date])>=Date() Or
tblPatientProtocolActivity.D1Tx>+ Date()
ORDER BY tblPatientProtocolActivity.D1Tx DESC ,
tblPatientProtocolActivity.[ICF date] DESC ,
tblPatientProtocolActivity.ScreeningDate DESC , tblPatients.MDID;
Date() is a function that returns the current system date.
[Date] would be a field with the name "Date" and it would exists in some
table. In this SQL it would have to exist in table tblPatients or in
tblPatientProctocolActivity.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
I tried the following & got a syntax error:
SELECT tblPatientProtocolActivity.D1Tx, tblPatientProtocolActivity.[ICF
date], tblPatientProtocolActivity.ScreeningDate, tblPatients.LastName,
tblPatients.FirstName, tblPatients.MRN, tblPatientProtocolActivity.Prot_ID,
tblPatientProtocolActivity.PtStatusID, tblPatients.MDID,
tblPatientProtocolActivity.Comments
FROM tblPatients INNER JOIN tblPatientProtocolActivity ON tblPatients.PtID =
tblPatientProtocolActivity.PtID
WHERE (((tblPatientProtocolActivity.ScreeningDate)>Date() Or
(tblPatientProtocolActivity.ScreeningDate Date())) OR
(((tblPatientProtocolActivity.[ICF date])> Date() Or
(tblPatientProtocolActivity.[ICF date])= Date())) OR
(((tblPatientProtocolActivity.D1Tx)> Date() Or
(tblPatientProtocolActivity.D1Tx)= Date()))
ORDER BY tblPatientProtocolActivity.D1Tx DESC ,
tblPatientProtocolActivity.[ICF date] DESC ,
tblPatientProtocolActivity.ScreeningDate DESC , tblPatients.MDID;
I'm not sure where to use Date() - and I don't know why that would be the
best option. Can you please help me to understand?
Thanks.