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  

Query using a date criteria



 
 
Thread Tools Display Modes
  #1  
Old December 28th, 2009, 04:18 PM posted to microsoft.public.access.queries
Eric Starn
external usenet poster
 
Posts: 45
Default Query using a date criteria

I have a query that I have set the criteria by a date field - "=#12/1/2009#"
What I would like to do is have the query run with the same operators but
with a date that has been input by the user.
I am not sure how to write it for that use.

Thanks

Eric
  #2  
Old December 28th, 2009, 04:36 PM posted to microsoft.public.access.queries
NuBie via AccessMonster.com
external usenet poster
 
Posts: 67
Default Query using a date criteria

Set your criteria something like any of these. I think 2 is what you're after.


1. WHERE ([DateField] Between [Enter Begin Date] And [Enter End Date]);

OR

2. WHERE [DateField] = [Enter Begin Date]


Eric Starn wrote:
I have a query that I have set the criteria by a date field - "=#12/1/2009#"
What I would like to do is have the query run with the same operators but
with a date that has been input by the user.
I am not sure how to write it for that use.

Thanks

Eric


--
Message posted via http://www.accessmonster.com

  #3  
Old December 28th, 2009, 05:00 PM posted to microsoft.public.access.queries
S.Clark[_2_]
external usenet poster
 
Posts: 423
Default Query using a date criteria

"=#[Enter Date]#"

"Eric Starn" wrote:

I have a query that I have set the criteria by a date field - "=#12/1/2009#"
What I would like to do is have the query run with the same operators but
with a date that has been input by the user.
I am not sure how to write it for that use.

Thanks

Eric

  #4  
Old December 28th, 2009, 05:22 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query using a date criteria

On Mon, 28 Dec 2009 08:18:02 -0800, Eric Starn
wrote:

I have a query that I have set the criteria by a date field - "=#12/1/2009#"
What I would like to do is have the query run with the same operators but
with a date that has been input by the user.
I am not sure how to write it for that use.

Thanks

Eric


I'd suggest just

= [Enter start date:]


If you do so it's a good idea - and sometimes necessary - to use the query's
Parameters collection. To do so open the query in design view, rightclick the
grey background of the tables, and select Parameters from the dropdown. Put

[Enter start date:]

in the left column - it must match your parameter exactly - and select
Date/Time in the right. Doing so makes the # delimiters unnecessary.
--

John W. Vinson [MVP]
 




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 06:08 AM.


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