Quering date field with two text boxes

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
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top