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
|
|||
|
|||
REQ: Need Criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 Please...TIA
I have a query that that prints a bunch of payment records. I need to
beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph |
#2
|
|||
|
|||
Ralph
In the query criteria type the following exactly: Between [Start Date] and [End Date] This will bring up two seperate dialog boxes asking for the start and end date, if you want to change the wording, use some thing different between the square brackets. HTH Neil www.nwarwick.co.uk "Ralph Malph" wrote: I have a query that that prints a bunch of payment records. I need to beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph |
#3
|
|||
|
|||
Hi Ralph,
Use a criteria like this in your date field: Between [Enter Start Date] And [Enter End Date] One word of caution: If the dates entered in your database contain a time component, then you may miss a record that occurs on the ending date. The Date/Time datatype is saved as a number, with the integer portion representing the time of day. For example, April 16, 2005 at 9:00 PM is actually saved in the table as 38458.875. If the ending date that you enter is April 16, 2005, the integer portion will equal zero. Thus the record at 9:00 PM on the same day would be greater in value than the criteria entered. If you have a time component included, then modify the criteria as follows: =[Enter Start Date] And DateAdd("d",1,[Enter End Date]) Rather than use a parameter query, you might want to use a form instead. You can enter the two dates into textboxes on the form. When you click an OK button, to run the report, you hide the form. The query's criteria looks to the open form to pick up the date values. This will also provide an easy way for you to print the from and to dates on the report, since you can grab them from the hidden, but still open, form. If you'd like a working example, send me a private e-mail message. Please do not post your e-mail address to a reply in any newsgroup (unless you love the idea of getting spammed to death). Tom QWCaos168@XScom cas t . Dnet (---Remove all capitolized letters and spaces). ________________________________________ "Ralph Malph" wrote: I have a query that that prints a bunch of payment records. I need to beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph |
#4
|
|||
|
|||
Thanks Tom !!!! will contact you via e-mail directly....THANKS again
!!!! On Sat, 16 Apr 2005 23:17:02 -0700, "Tom Wickerath" AOS168 AT @comcast DOT net wrote: Hi Ralph, Use a criteria like this in your date field: Between [Enter Start Date] And [Enter End Date] One word of caution: If the dates entered in your database contain a time component, then you may miss a record that occurs on the ending date. The Date/Time datatype is saved as a number, with the integer portion representing the time of day. For example, April 16, 2005 at 9:00 PM is actually saved in the table as 38458.875. If the ending date that you enter is April 16, 2005, the integer portion will equal zero. Thus the record at 9:00 PM on the same day would be greater in value than the criteria entered. If you have a time component included, then modify the criteria as follows: =[Enter Start Date] And DateAdd("d",1,[Enter End Date]) Rather than use a parameter query, you might want to use a form instead. You can enter the two dates into textboxes on the form. When you click an OK button, to run the report, you hide the form. The query's criteria looks to the open form to pick up the date values. This will also provide an easy way for you to print the from and to dates on the report, since you can grab them from the hidden, but still open, form. If you'd like a working example, send me a private e-mail message. Please do not post your e-mail address to a reply in any newsgroup (unless you love the idea of getting spammed to death). Tom QWCaos168@XScom cas t . Dnet (---Remove all capitolized letters and spaces). ________________________________________ "Ralph Malph" wrote: I have a query that that prints a bunch of payment records. I need to beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph |
#5
|
|||
|
|||
On Sun, 17 Apr 2005 04:15:24 GMT, Ralph Malph
wrote: I have a query that that prints a bunch of payment records. I need to beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph Simply use a criterion of BETWEEN [Enter start date:] AND [Enter end date:] John W. Vinson[MVP] |
#6
|
|||
|
|||
On Sat, 16 Apr 2005 22:59:01 -0700, "Neil"
wrote: Ralph In the query criteria type the following exactly: Between [Start Date] and [End Date] This will bring up two seperate dialog boxes asking for the start and end date, if you want to change the wording, use some thing different between the square brackets. HTH Neil www.nwarwick.co.uk "Ralph Malph" wrote: I have a query that that prints a bunch of payment records. I need to beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph |
#7
|
|||
|
|||
On Sun, 17 Apr 2005 21:10:43 -0600, John Vinson
wrote: On Sun, 17 Apr 2005 04:15:24 GMT, Ralph Malph wrote: I have a query that that prints a bunch of payment records. I need to beable to print just the records with in a specific time frame. I can do it if I hard code the date range into the query, but I want it to ask me for the start date and end date, so I need a criteria expression that will ask for "from" and "to" dates and then select records that fall within that date span for access 2000 please. Thanks for helping in advance. Ralph Malph Simply use a criterion of BETWEEN [Enter start date:] AND [Enter end date:] John W. Vinson[MVP] |
#8
|
|||
|
|||
Tom,
THANK you very much for the sample DBs. I can see a way to do what I want with these examples. Thanks again !!!!!! Ralph Malph |
#9
|
|||
|
|||
You're welcome. Glad I could help.
Tom _____________________________________ "Ralph Malph" wrote: Tom, THANK you very much for the sample DBs. I can see a way to do what I want with these examples. Thanks again !!!!!! Ralph Malph |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Data type mismatch in criteria expression. | ian | Running & Setting Up Queries | 2 | December 13th, 2004 05:45 PM |
Writing Criteria Expression | amyfinlay | Running & Setting Up Queries | 1 | October 15th, 2004 03:24 AM |
Data type mismatch in criteria expression | Tcs | Running & Setting Up Queries | 2 | October 8th, 2004 08:05 PM |