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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|