I am using the query below and when I try to test it out I get "Syntax Error
(missing operator) in query expression 'ServiceNote.DateWritten >=
CDate([Enter start date:]) AND < DateAdd("d",1,CDate([Enter end date:]))'.
Can you help me out
SELECT ParticipantInfo.LastName, ParticipantInfo.FirstName,
ParticipantInfo.Medicaid, ParticipantInfo.Intensive,
ParticipantInfo.FundingSource, ParticipantInfo.ValuedOutcome,
ServiceNote.Location, ServiceNote.DateServiceStart,
ServiceNote.DateServiceEnd, ServiceNote.ServiceProvided,
ServiceNote.ResponseRendered, ServiceNote.DateToSign,
ServiceNote.DateWritten, ServiceNote.[Notes-SpecialInstructions],
IntensiveTimeLog.[1Date], IntensiveTimeLog.[1WKH], IntensiveTimeLog.[1PE],
IntensiveTimeLog.[1ON], IntensiveTimeLog.[1OFF], IntensiveTimeLog.[2Date],
IntensiveTimeLog.[2WKH], IntensiveTimeLog.[2PE], IntensiveTimeLog.[2ON],
IntensiveTimeLog.[2OFF], IntensiveTimeLog.[3Date], IntensiveTimeLog.[3WKH],
IntensiveTimeLog.[3PE], IntensiveTimeLog.[3ON], IntensiveTimeLog.[3OFF],
IntensiveTimeLog.[4Date], IntensiveTimeLog.[4WKH], IntensiveTimeLog.[4PE],
IntensiveTimeLog.[4ON], IntensiveTimeLog.[4OFF], IntensiveTimeLog.[5Date],
IntensiveTimeLog.[5WKH], IntensiveTimeLog.[5PE], IntensiveTimeLog.[5ON],
IntensiveTimeLog.[5OFF], IntensiveTimeLog.[6Date], IntensiveTimeLog.[6WKH],
IntensiveTimeLog.[6PE], IntensiveTimeLog.[6ON], IntensiveTimeLog.[6OFF],
IntensiveTimeLog.[7Date], IntensiveTimeLog.[7WKH], IntensiveTimeLog.[7PE],
IntensiveTimeLog.[7ON], IntensiveTimeLog.[7OFF]
FROM (ParticipantInfo INNER JOIN ServiceNote ON
ParticipantInfo.ParticipantID = ServiceNote.ParicipantID) INNER JOIN
IntensiveTimeLog ON ServiceNote.ServiceNoteID = IntensiveTimeLog.ServiceNoteID
WHERE ServiceNote.DateWritten >= CDate([Enter start date:]) AND <
DateAdd("d", 1, CDate([Enter end date:]));
John Vinson said:
Good morning,
I need to know how to set up and what to use as criteria for a parameter
query that will prompt for a start date and end date and then bring up
records = to and between those dates. I was thinking of creating a start date
field w/ criteria >= and end date field w/ criteria of <= but I am not sure
if that will work or what syntax I should use to include a control statement
like >= and a prompt statement like [Enter Start Date:]. Any suggestions?
Thanks.
It makes a difference if the table field you're searching has (or
might have) a time component: #7/1/2005 17:58:20# is in fact NOT
between #6/30/2005# and #7/1/2005#, though you may well want that
record retrieved.
A robust criterion which works for me is
= CDate([Enter start date:]) AND < DateAdd("d", 1, CDate([Enter end date:]))
John W. Vinson[MVP]