group by query

G

gls858

I have a group by query that has a field InvoiceDate

I have the criteria of Between [Start Date] and [End Date] to prompt for
the date range.

The Total parameter is set to Where.

I have the report that I want but I would like to pull this date range
as a field in my report header. Something like

My Report
Date 06/01/09 - 06/30/09

How do I add this date range to the report header?

gls858
 
J

Jeff Boyce

One approach (klunky kludge) would be to prompt in the query, then prompt
AGAIN in the report. Nope, I don't like it either!

Another (more work, but less work each time you run the report) approach is
to create a "report order form". In that form, add two unbound textboxes.
Enter the Start and End date values in those two. Add a control button that
opens the report.

Modify your query to point to the form to get the parameters. Of course,
your form has to be open and the controls filled for this approach to work.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Douglas J. Steele

Add the prompts to the query, then use those fields in your report.

SELECT Field1, Field2, Field3, TransDate, [Start Date], [End Date]
FROM MyTable
WHERE TransDate BETWEEN [Start Date] AND [End Date]

Now, in your report, you can refer to Me![Start Date] and Me![End Date]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jeff Boyce said:
One approach (klunky kludge) would be to prompt in the query, then prompt
AGAIN in the report. Nope, I don't like it either!

Another (more work, but less work each time you run the report) approach
is to create a "report order form". In that form, add two unbound
textboxes. Enter the Start and End date values in those two. Add a
control button that opens the report.

Modify your query to point to the form to get the parameters. Of course,
your form has to be open and the controls filled for this approach to
work.

Regards

Jeff Boyce
Microsoft Office/Access MVP

gls858 said:
I have a group by query that has a field InvoiceDate

I have the criteria of Between [Start Date] and [End Date] to prompt for
the date range.

The Total parameter is set to Where.

I have the report that I want but I would like to pull this date range as
a field in my report header. Something like

My Report
Date 06/01/09 - 06/30/09

How do I add this date range to the report header?

gls858
 
J

Jeff Boyce

Aha! I get it. If you add two new fields in your query, they'll be
available as fields in your report!

Slick!

Jeff

Douglas J. Steele said:
Add the prompts to the query, then use those fields in your report.

SELECT Field1, Field2, Field3, TransDate, [Start Date], [End Date]
FROM MyTable
WHERE TransDate BETWEEN [Start Date] AND [End Date]

Now, in your report, you can refer to Me![Start Date] and Me![End Date]

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jeff Boyce said:
One approach (klunky kludge) would be to prompt in the query, then prompt
AGAIN in the report. Nope, I don't like it either!

Another (more work, but less work each time you run the report) approach
is to create a "report order form". In that form, add two unbound
textboxes. Enter the Start and End date values in those two. Add a
control button that opens the report.

Modify your query to point to the form to get the parameters. Of course,
your form has to be open and the controls filled for this approach to
work.

Regards

Jeff Boyce
Microsoft Office/Access MVP

gls858 said:
I have a group by query that has a field InvoiceDate

I have the criteria of Between [Start Date] and [End Date] to prompt for
the date range.

The Total parameter is set to Where.

I have the report that I want but I would like to pull this date range
as a field in my report header. Something like

My Report
Date 06/01/09 - 06/30/09

How do I add this date range to the report header?

gls858
 

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