A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date query in Dialog box question



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2004, 11:11 PM
joe
external usenet poster
 
Posts: n/a
Default Date query in Dialog box question

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

  #2  
Old June 5th, 2004, 12:52 AM
John Vinson
external usenet poster
 
Posts: n/a
Default Date query in Dialog box question

On Fri, 4 Jun 2004 15:11:02 -0700, joe
wrote:

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.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.