Quering date field with two text boxes

  • Thread starter Thread starter Joshua Wolfe
  • Start date Start date
J

Joshua Wolfe

I am trying to do a query that will return all records in which a "Date"
field is between two text boxes on a form. What I have is something like
this:

Select * from table where date_field Between [forms]![form]![textbox1].
[text] And [forms]![form]![textbox2].[text];

But when I do this I do not get any records returned. Please help.

Thanks,
Josh
 
See if this will work:

Select * from table where date_field Between "#" &
[forms]![form]![textbox1].[text] & "#" And "#" &
[forms]![form]![textbox2].[text] & "#";

This will put "date delimiters" around the value so that Access knows it is
a date and not a division equation.
 
Back
Top