Date query in Dialog box question

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top