View Full Version : Begin and End Date
ecuevas 01-09-2008, 11:57 AM I have a report based on a query that finds the average response time. When I run the report it prompts me for a begin date and an end date. Then the report shows the average resopnse time between those two dates. How can I get the two dates I entered to show up on the report?
rainman89 01-09-2008, 12:19 PM Best way to do it is instead of calling the dates from the query, call them from a form.
then put a textbox on your report with forms!yourformname.startdate and another forms!yourformname.enddate on there.
if you need help adjusting your query to reflect that you are using a form you would do
Between forms!yourformname.startdate AND forms!yourformname.enddate as the criteria
ecuevas 01-09-2008, 12:30 PM What would I put in the report?
KeithG 01-09-2008, 12:34 PM Just reference the controls on your form the same as you did in the criteria of your query
ecuevas 01-09-2008, 01:46 PM I think you misunderstood my question. I already have a prompt. I just need the dates that I type in to the prompt to appear on the report.
rainman89 01-09-2008, 03:24 PM create your own prompt. it sounds to me like you are using the query prompt.
use a form as your prompt and you will be able to do what you are wanting
KeithG 01-09-2008, 05:40 PM As long as your form is open when you open the report you can reference the control on your form with the begin and End data. Something like below in the control source of you control in your form
=forms!yourformname.startdate
ecuevas 01-10-2008, 06:52 AM I got the dates to show up but now the average won't show up.
rainman89 01-10-2008, 07:33 AM make sure to change the values in the average calculation too
ecuevas 01-10-2008, 08:41 AM I changed it to Between ([Customer Complaint Log].[Date of Complaint])=[forms]![AVERAGE].[startdate] And ([Customer Complaint Log].[Date of Complaint])=[forms]![AVERAGE].[enddate] but it doesn't do anything when I run it.
rainman89 01-10-2008, 08:47 AM I changed it to Between ([Customer Complaint Log].[Date of Complaint])=[forms]![AVERAGE].[startdate] And ([Customer Complaint Log].[Date of Complaint])=[forms]![AVERAGE].[enddate] but it doesn't do anything when I run it.
ok. you dont need to set the variable
it would be
Between ([forms]![AVERAGE].[startdate] And [forms]![AVERAGE].[enddate]
ecuevas 01-10-2008, 10:03 AM It says I did not enter the And in the Between...And operator
rainman89 01-10-2008, 10:04 AM can you post a sample so we can see what we are dealing with here?
ecuevas 01-10-2008, 10:20 AM Is there a way that I can get the dates onto the report from the query prompt instead of the form?
rainman89 01-10-2008, 10:27 AM Not that i know of but
Between [forms]![AVERAGE].[startdate] And [forms]![AVERAGE].[enddate]
should work
ecuevas 01-10-2008, 10:44 AM how do I get a form to open up when I open a report.
Brianwarnock 01-10-2008, 10:57 AM In the context of this thread you should open the form, enter the criteria, select the command button to preview the report.
Brian
ecuevas 01-10-2008, 11:34 AM I got it to work. Thank you rainman.
rainman89 01-10-2008, 11:41 AM and brian and neil
you are welcome
happy to help
|