Date query in Dialog box question

G

Guest

Hello,
I want to have a parameter query to search by date----"from date" and "to date".Is there some default expression that i can use as a criteria instead of typing a date
so when the query is run and the dialog appears, the user would be prompted to enter the "from date" "to date".Is there something like 00/00/2004 thru 00/00/2004
Thank
 
J

John Vinson

Hello,
I want to have a parameter query to search by date----"from date" and "to date".Is there some default expression that i can use as a criteria instead of typing a date
so when the query is run and the dialog appears, the user would be prompted to enter the "from date" "to date".Is there something like 00/00/2004 thru 00/00/2004?
Thanks

I'd suggest using a small Form (frmCrit let's call it) with two
textboxes, txtFrom and txtTo. You can set the Default properties of
these two controls - say, if you want to have the default be "year to
date", you could set the default property of txtFrom to

=DateSerial(Year(Date()), 1, 1)

and txtTo to Date().

Your query would then use
= Forms!frmCrit!txtFrom AND <= Forms!frmCrit!txtTo

as a criterion on the date field.

The simpler [Enter date:] parameter queries don't support defaults, at
least not in a user-friendly manner.
 

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