Between Dates Dilemma

  • Thread starter Thread starter M
  • Start date Start date
M

M

I have a query that gets results from three tables. The
main criteria of this query is a 'Between' date range. I
want to change the way the query gets these dates from a
simple user input when the query runs to a textbox on an
unbound form.
I changed all of the instances of [Start Date] to [Forms]!
[frmForm]![txtStartDate] and the same for the [End Date].
However, when I run the query I get incomplete results.
Not all of the fields are returning results. I've checked
all of the instances of date ranges and everything seems
to be in order. I've changed the '***![txtStartDate]' back
to [Start Date] and I get all of the results. Then back
again and only some of the results. Any ideas?

Thanks

M
 
Try enclosing the textbox between "#":
="#" & [frmForm]![txtStartDate] & "#"
Most probably you getting a 'string date' instead of an actual date format.

--
Victor Delgadillo [MVP Access]
Miami, Florida

Consultas al grupo, asi todos nos beneficiamos.

_
 
I got it. One of the fields was comparing records to a
previous date, along with the date range. When I explicity
stated the date range it couldn't compare the rest of the
fields.

Thanks for your reply

M

-----Original Message-----
Try enclosing the textbox between "#":
="#" & [frmForm]![txtStartDate] & "#"
Most probably you getting a 'string date' instead of an actual date format.

--
Victor Delgadillo [MVP Access]
Miami, Florida

Consultas al grupo, asi todos nos beneficiamos.

_
M said:
I have a query that gets results from three tables. The
main criteria of this query is a 'Between' date range. I
want to change the way the query gets these dates from a
simple user input when the query runs to a textbox on an
unbound form.
I changed all of the instances of [Start Date] to [Forms]!
[frmForm]![txtStartDate] and the same for the [End Date].
However, when I run the query I get incomplete results.
Not all of the fields are returning results. I've checked
all of the instances of date ranges and everything seems
to be in order. I've changed the '***![txtStartDate]' back
to [Start Date] and I get all of the results. Then back
again and only some of the results. Any ideas?

Thanks

M


.
 
Back
Top