Parameter Query using date ranges

A

aspickwick

I am creating a parameter query where I want to pull data between 2 dates.
In the date criteria of my query, if I write between #01/01/2008# and
#01/31/2008# +1, I will get all data for January. If I use a form to enter
the dates and have Between [Forms]![autoexec]![start] And
[Forms]![autoexec]![end] +1 in the date criteria, I get an error. Does
anyone know what I should put in the criteria to make the query work?
 
D

Duane Hookom

Are you entering your dates as m/d/y?
What happens if you try:
DateAdd("d", 1, [Forms]![autoexec]![end])
Is the form open?
 
A

aspickwick

Yes the form is open. I changed it to include the DateAdd function and it
works great. Thank you for the help!

Duane Hookom said:
Are you entering your dates as m/d/y?
What happens if you try:
DateAdd("d", 1, [Forms]![autoexec]![end])
Is the form open?

--
Duane Hookom
Microsoft Access MVP


aspickwick said:
I am creating a parameter query where I want to pull data between 2 dates.
In the date criteria of my query, if I write between #01/01/2008# and
#01/31/2008# +1, I will get all data for January. If I use a form to enter
the dates and have Between [Forms]![autoexec]![start] And
[Forms]![autoexec]![end] +1 in the date criteria, I get an error. Does
anyone know what I should put in the criteria to make the query work?
 

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