Referencing Date Range From Query on report

G

Guest

I have a query that prompts for a beginning and ending date. It does so with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of the
report?

Thanks,
RandyM
 
J

John Spencer

Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.
 
M

Marshall Barton

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of the
report?



Just refer to the prompt strings as if they were fields in
the query. E.g. an text box could use an expresison like:

="Orders from " & [Enter Start Date] & " to " & [Enter End
Date]
 
G

Guest

Thanks John, works perfectly.

RandyM

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
G

Guest

Thanks John, appreciate your help. I think I might've posted this thank you
in my previous plea for help. OOps :)

Thanks again,
RandyM

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
G

Guest

Thanks Marshall, I appreciate you and John taking time to answer.

RandyM

Marshall Barton said:
WCDoan said:
I have a query that prompts for a beginning and ending date. It does so with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of the
report?



Just refer to the prompt strings as if they were fields in
the query. E.g. an text box could use an expresison like:

="Orders from " & [Enter Start Date] & " to " & [Enter End
Date]
 
G

Guest

Hey Guy's, I have the same problem but this answer doesn't work for me. To do
it this way means the user has to enter the Start Date and End Date when the
Query is opened and enter them again when the Report is opened. Is there any
way to just enter the Dates once?

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
D

Duane Hookom

Get all of your criteria from controls on forms. then use something like:
= "Between " & Forms!frmDates!txtStart & " And " & Forms!frmDates!txtEnd

--
Duane Hookom
MS Access MVP


Hoopster said:
Hey Guy's, I have the same problem but this answer doesn't work for me. To
do
it this way means the user has to enter the Start Date and End Date when
the
Query is opened and enter them again when the Report is opened. Is there
any
way to just enter the Dates once?

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
G

Guest

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM


This answer has worked for me also but I would like to set a control to format how the date prints. (Such as March 1, 2007 not 3/1/07.) How do I set the format default?
 
J

John Spencer

Use the format function around the parameters to force a format.

= "Between " & Format([Enter Start Date],"mmmm d, yyyy") & " And " &
Format([Enter End Date],"mmmm d, yyyy")

This answer has worked for me also but I would like to set a control to
format how the date prints. (Such as March 1, 2007 not 3/1/07.) How
do I set the format default?


'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM

This answer has worked for me also but I would like to set a control to format how the date prints. (Such as March 1, 2007 not 3/1/07.) How do I set the format default?
 
B

Brian

I tried this, but it did not work for me. It gave me an error when I run my
report. in order to select dates on my report my code is "WHERE ((([Out
Processing Data Sheet Table].[Today's Date])>=[Please Enter Start Report Date
DD-MMM-YY] And ([Out Processing Data Sheet Table].[Today's Date])<=[Please
Enter Ending Report Date DD-MMM-YY]) AND (([Out Processing Data Sheet
Table].Reason)="PCS") AND (([Out Processing Data Sheet Table].WIA)=True));".

Can you help?

Thank You

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
D

Douglas J. Steele

="Between " & [Please Enter Start Report Date DD-MMM-YY] & " And " & [Please
Enter Ending Report Date DD-MMM-YY]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brian said:
I tried this, but it did not work for me. It gave me an error when I run
my
report. in order to select dates on my report my code is "WHERE ((([Out
Processing Data Sheet Table].[Today's Date])>=[Please Enter Start Report
Date
DD-MMM-YY] And ([Out Processing Data Sheet Table].[Today's Date])<=[Please
Enter Ending Report Date DD-MMM-YY]) AND (([Out Processing Data Sheet
Table].Reason)="PCS") AND (([Out Processing Data Sheet
Table].WIA)=True));".

Can you help?

Thank You

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

WCDoan said:
I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
B

Brian

should I put this line as the control for the report? The lines below are
from the Quirey that the report is drawn from.

Thank You

Douglas J. Steele said:
="Between " & [Please Enter Start Report Date DD-MMM-YY] & " And " & [Please
Enter Ending Report Date DD-MMM-YY]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brian said:
I tried this, but it did not work for me. It gave me an error when I run
my
report. in order to select dates on my report my code is "WHERE ((([Out
Processing Data Sheet Table].[Today's Date])>=[Please Enter Start Report
Date
DD-MMM-YY] And ([Out Processing Data Sheet Table].[Today's Date])<=[Please
Enter Ending Report Date DD-MMM-YY]) AND (([Out Processing Data Sheet
Table].Reason)="PCS") AND (([Out Processing Data Sheet
Table].WIA)=True));".

Can you help?

Thank You

John Spencer said:
Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

I have a query that prompts for a beginning and ending date. It does so
with
this statement in the criteria box of the FeeDate column on the query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header of
the
report?

Thanks,
RandyM
 
D

Douglas J. Steele

As John said, add a control to your report header and set its control source
to that expression (including the equal sign).

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brian said:
should I put this line as the control for the report? The lines below are
from the Quirey that the report is drawn from.

Thank You

Douglas J. Steele said:
="Between " & [Please Enter Start Report Date DD-MMM-YY] & " And " &
[Please
Enter Ending Report Date DD-MMM-YY]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brian said:
I tried this, but it did not work for me. It gave me an error when I
run
my
report. in order to select dates on my report my code is "WHERE
((([Out
Processing Data Sheet Table].[Today's Date])>=[Please Enter Start
Report
Date
DD-MMM-YY] And ([Out Processing Data Sheet Table].[Today's
Date])<=[Please
Enter Ending Report Date DD-MMM-YY]) AND (([Out Processing Data Sheet
Table].Reason)="PCS") AND (([Out Processing Data Sheet
Table].WIA)=True));".

Can you help?

Thank You

:

Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

I have a query that prompts for a beginning and ending date. It does
so
with
this statement in the criteria box of the FeeDate column on the
query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header
of
the
report?

Thanks,
RandyM
 
B

Brian

That worked. Thank you for your help

Douglas J. Steele said:
As John said, add a control to your report header and set its control source
to that expression (including the equal sign).

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Brian said:
should I put this line as the control for the report? The lines below are
from the Quirey that the report is drawn from.

Thank You

Douglas J. Steele said:
="Between " & [Please Enter Start Report Date DD-MMM-YY] & " And " &
[Please
Enter Ending Report Date DD-MMM-YY]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I tried this, but it did not work for me. It gave me an error when I
run
my
report. in order to select dates on my report my code is "WHERE
((([Out
Processing Data Sheet Table].[Today's Date])>=[Please Enter Start
Report
Date
DD-MMM-YY] And ([Out Processing Data Sheet Table].[Today's
Date])<=[Please
Enter Ending Report Date DD-MMM-YY]) AND (([Out Processing Data Sheet
Table].Reason)="PCS") AND (([Out Processing Data Sheet
Table].WIA)=True));".

Can you help?

Thank You

:

Add a control to your report header
Set is control source to

= "Between " & [Enter Start Date] & " And " & [Enter End Date]

You can treat parameters in the report's record source as if they were
fields.

I have a query that prompts for a beginning and ending date. It does
so
with
this statement in the criteria box of the FeeDate column on the
query:

Between [Enter Start Date] And [Enter End Date].

How do I print the dates that were entered by the user on the header
of
the
report?

Thanks,
RandyM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top