P
Phill
I have a query that needs to filter by date/time (work
shifts (Between 3/2/04 7:00:00 PM AND 3/3/04 7:00:00
AM). I tried setting up the query 2 ways 1) with a
string parameter that contained the Between clause, and
2) 2 datetime parameters (FromDate and ToDate) and the
where clause of the query was Between [FromDate] and
[EndDate]. Neither way works. I get and error saying
either wrong data type or wrong number of parameters #
expected. What is the correct way to do this? Oh, my
code for executing the query is:
Dim qdf as QueryDef
set qdf=currentdb.querydefs("query1")
with qdf
.parameters("FromDate")="3/2/04 7:00:00 PM"
.parameters("EndDate")="3/3/04 7:00:00 AM"
.execute
end with
shifts (Between 3/2/04 7:00:00 PM AND 3/3/04 7:00:00
AM). I tried setting up the query 2 ways 1) with a
string parameter that contained the Between clause, and
2) 2 datetime parameters (FromDate and ToDate) and the
where clause of the query was Between [FromDate] and
[EndDate]. Neither way works. I get and error saying
either wrong data type or wrong number of parameters #
expected. What is the correct way to do this? Oh, my
code for executing the query is:
Dim qdf as QueryDef
set qdf=currentdb.querydefs("query1")
with qdf
.parameters("FromDate")="3/2/04 7:00:00 PM"
.parameters("EndDate")="3/3/04 7:00:00 AM"
.execute
end with