Adding Date Criteria to Report Heading

J

Jeff

I have created a report that uses a query as it's data
source. In the query, the critera on a date field is set
to "Between [Enter the Beginning Date} AND [Enter the
Ending Date]".

How can I caputure those dates so that when the report
runs, in the heading of the report I can print the title
along with "For Dates From xx/xx/xxxx to xx/xx/xxxx"
filling in the dates using those entered by the user?

Thanks in advance for your help.

Jeff
 
M

Marshall Barton

Jeff said:
I have created a report that uses a query as it's data
source. In the query, the critera on a date field is set
to "Between [Enter the Beginning Date} AND [Enter the
Ending Date]".

How can I caputure those dates so that when the report
runs, in the heading of the report I can print the title
along with "For Dates From xx/xx/xxxx to xx/xx/xxxx"
filling in the dates using those entered by the user?


Just use the prompt strings as if they were a field in the
query:

= "Between " & [Enter the Beginning Date} & " AND " & [Enter
the Ending Date]
 
J

Jeff

You mean use them that way in the query?

I am sorry but still do not understand how to get that
information prompted for in the query,....to the header
of the report.

-----Original Message-----
Jeff said:
I have created a report that uses a query as it's data
source. In the query, the critera on a date field is set
to "Between [Enter the Beginning Date} AND [Enter the
Ending Date]".

How can I caputure those dates so that when the report
runs, in the heading of the report I can print the title
along with "For Dates From xx/xx/xxxx to xx/xx/xxxx"
filling in the dates using those entered by the user?


Just use the prompt strings as if they were a field in the
query:

= "Between " & [Enter the Beginning Date} & " AND " & [Enter
the Ending Date]
 
M

Marshall Barton

Jeff said:
You mean use them that way in the query?

Well, you could, but that's not waht I was saying.

I am sorry but still do not understand how to get that
information prompted for in the query,....to the header
of the report.

What I was suggesting is to place a text box in the report's
header section and use the expression I provided.
--
Marsh
MVP [MS Access]


-----Original Message-----
Jeff said:
I have created a report that uses a query as it's data
source. In the query, the critera on a date field is set
to "Between [Enter the Beginning Date} AND [Enter the
Ending Date]".

How can I caputure those dates so that when the report
runs, in the heading of the report I can print the title
along with "For Dates From xx/xx/xxxx to xx/xx/xxxx"
filling in the dates using those entered by the user?


Just use the prompt strings as if they were a field in the
query:

= "Between " & [Enter the Beginning Date} & " AND " &
[Enter the Ending Date]
 
J

Jeff

-----Original Message-----
Jeff said:
You mean use them that way in the query?

Well, you could, but that's not waht I was saying.

I am sorry but still do not understand how to get that
information prompted for in the query,....to the header
of the report.

What I was suggesting is to place a text box in the report's
header section and use the expression I provided.
--
Marsh
MVP [MS Access]


-----Original Message-----
Jeff wrote:

I have created a report that uses a query as it's data
source. In the query, the critera on a date field is set
to "Between [Enter the Beginning Date} AND [Enter the
Ending Date]".

How can I caputure those dates so that when the report
runs, in the heading of the report I can print the title
along with "For Dates From xx/xx/xxxx to xx/xx/xxxx"
filling in the dates using those entered by the user?


Just use the prompt strings as if they were a field in the
query:

= "Between " & [Enter the Beginning Date} & " AND " &
[Enter the Ending Date]

.
Ok....This is very helpful (thanks for that), and I
think I am on to something.....(very new at this)

I did place a text box in the header with your suggested
expression. It left the words "Between" and "And" in the
header of the report, but when I ran the report, I was
prompted for the date twice.

Now I question whether I even need a query! Can I not
just write that report choosing fields directly from the
table and not the query, then pass the date parameters on
the appropriate field directly from the report user
prompts when it is run?

Thanks again.

Jeff
 
M

Marshall Barton

Marshall said:
Jeff said:
You mean use them that way in the query?

Well, you could, but that's not waht I was saying.

I am sorry but still do not understand how to get that
information prompted for in the query,....to the header
of the report.

What I was suggesting is to place a text box in the report's
header section and use the expression I provided.

-----Original Message-----
Jeff wrote:

I have created a report that uses a query as it's data
source. In the query, the critera on a date field is
set
to "Between [Enter the Beginning Date} AND [Enter the
Ending Date]".

How can I caputure those dates so that when the report
runs, in the heading of the report I can print the
title
along with "For Dates From xx/xx/xxxx to xx/xx/xxxx"
filling in the dates using those entered by the user?


Marshall Barton wrote:
Just use the prompt strings as if they were a field in
the query:

= "Between " & [Enter the Beginning Date] & " AND " &
[Enter the Ending Date]
Jeff said:
Ok....This is very helpful (thanks for that), and I
think I am on to something.....(very new at this)

I did place a text box in the header with your suggested
expression. It left the words "Between" and "And" in the
header of the report, but when I ran the report, I was
prompted for the date twice.

If you're prompted twice, most likely you have a slight
difference from what you used in the query to what you used
in the text box. They must be **exactly** the same
including the [ ]

Now I question whether I even need a query! Can I not
just write that report choosing fields directly from the
table and not the query, then pass the date parameters on
the appropriate field directly from the report user
prompts when it is run?

You need to use a query because you want to apply the
criteria to filter the data in the table. What you suggest
will display in the report, but it won't filter the data.

While there are several other ways to filter the data, you
should at least get this working before you go on to more
sophisticated techniques.
 

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