Date range

J

John

I have a query that has an unbound field that in the criteria I can put a
date range in, what I would like to do is somehow link this to a form so that
I don't have to always go into the query and edit the criteria its current
format looks like this.
#1/4/2008# And <#1/11/2008#

Thanks in advance
 
A

Al Campagna

John,
In your query, substitute this criteria...
Between [Enter Start Date] And [Enter Ending Date]
This would create a "parameter" query. Whenever the query runs, Access
doesn't know what [Enter Start Date] and [Enter Ending Date] are, so it
opens an input box, and prompts the user for those values... one Input box
for each parameter.
If you enter 1/4/08 in response to the first Input box, and 1/11/08 in
response to the second Input box, you have, in effect created the same
criteria as your "hardwired" version.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

John

I neglected to mention that this field is a calculated field: "OrderDate1:
DateAdd("h",-5,[orderdate])" so if I use the between option I then get a
range that does not fit with that was entered. Also this field had a time
value in it as well.

Al Campagna said:
John,
In your query, substitute this criteria...
Between [Enter Start Date] And [Enter Ending Date]
This would create a "parameter" query. Whenever the query runs, Access
doesn't know what [Enter Start Date] and [Enter Ending Date] are, so it
opens an input box, and prompts the user for those values... one Input box
for each parameter.
If you enter 1/4/08 in response to the first Input box, and 1/11/08 in
response to the second Input box, you have, in effect created the same
criteria as your "hardwired" version.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


John said:
I have a query that has an unbound field that in the criteria I can put a
date range in, what I would like to do is somehow link this to a form so
that
I don't have to always go into the query and edit the criteria its current
format looks like this.

Thanks in advance
 
J

JP COHEN

John said:
I neglected to mention that this field is a calculated field: "OrderDate1:
DateAdd("h",-5,[orderdate])" so if I use the between option I then get a
range that does not fit with that was entered. Also this field had a time
value in it as well.

Al Campagna said:
John,
In your query, substitute this criteria...
Between [Enter Start Date] And [Enter Ending Date]
This would create a "parameter" query. Whenever the query runs,
Access
doesn't know what [Enter Start Date] and [Enter Ending Date] are, so it
opens an input box, and prompts the user for those values... one Input
box
for each parameter.
If you enter 1/4/08 in response to the first Input box, and 1/11/08 in
response to the second Input box, you have, in effect created the same
criteria as your "hardwired" version.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."


John said:
I have a query that has an unbound field that in the criteria I can put
a
date range in, what I would like to do is somehow link this to a form
so
that
I don't have to always go into the query and edit the criteria its
current
format looks like this.
#1/4/2008# And <#1/11/2008#

Thanks in advance
 

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