A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

group by query



 
 
Thread Tools Display Modes
  #1  
Old July 17th, 2009, 08:54 PM posted to microsoft.public.access.gettingstarted
gls858
external usenet poster
 
Posts: 473
Default group by query

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
  #2  
Old July 17th, 2009, 09:23 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default group by query

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" wrote in message
...
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



  #3  
Old July 17th, 2009, 10:10 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default group by query

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
http://I.Am/DougSteele
(no private e-mails, please)


"Jeff Boyce" wrote in message
...
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" wrote in message
...
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





  #4  
Old July 17th, 2009, 11:35 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default group by query

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" wrote in message
...
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
http://I.Am/DougSteele
(no private e-mails, please)


"Jeff Boyce" wrote in message
...
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" wrote in message
...
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







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.