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  

Grouping & Counting on a Field



 
 
Thread Tools Display Modes
  #1  
Old August 18th, 2006, 05:08 PM posted to microsoft.public.access.gettingstarted
SkyGuy
external usenet poster
 
Posts: 10
Default Grouping & Counting on a Field

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob
  #2  
Old August 18th, 2006, 05:55 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Grouping & Counting on a Field

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

  #3  
Old August 18th, 2006, 06:26 PM posted to microsoft.public.access.gettingstarted
SkyGuy
external usenet poster
 
Posts: 10
Default Grouping & Counting on a Field

Wow...that was easy and worked perfectly. Thank you!
But how do I display the number of reports written (as shown in the example
below)? I tried using the Access Question Box to find the answer but had no
luck.

"Klatuu" wrote:

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

  #4  
Old August 18th, 2006, 06:30 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Grouping & Counting on a Field

If your query is returning the number of records, put a text box on the
report and bind it to the field in the query that returns that value.

"SkyGuy" wrote:

Wow...that was easy and worked perfectly. Thank you!
But how do I display the number of reports written (as shown in the example
below)? I tried using the Access Question Box to find the answer but had no
luck.

"Klatuu" wrote:

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

  #5  
Old August 18th, 2006, 06:45 PM posted to microsoft.public.access.gettingstarted
SkyGuy
external usenet poster
 
Posts: 10
Default Grouping & Counting on a Field

I'm sorry but my query is not returning a count of reports per department and
I'm don't know how to do that. Can I create the Count in the report instead
of the query?

"Klatuu" wrote:

If your query is returning the number of records, put a text box on the
report and bind it to the field in the query that returns that value.

"SkyGuy" wrote:

Wow...that was easy and worked perfectly. Thank you!
But how do I display the number of reports written (as shown in the example
below)? I tried using the Access Question Box to find the answer but had no
luck.

"Klatuu" wrote:

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

  #6  
Old August 18th, 2006, 06:48 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Grouping & Counting on a Field

What is your query returning?
How do you know which reports are returned for a department?

"SkyGuy" wrote:

I'm sorry but my query is not returning a count of reports per department and
I'm don't know how to do that. Can I create the Count in the report instead
of the query?

"Klatuu" wrote:

If your query is returning the number of records, put a text box on the
report and bind it to the field in the query that returns that value.

"SkyGuy" wrote:

Wow...that was easy and worked perfectly. Thank you!
But how do I display the number of reports written (as shown in the example
below)? I tried using the Access Question Box to find the answer but had no
luck.

"Klatuu" wrote:

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

  #7  
Old August 18th, 2006, 07:51 PM posted to microsoft.public.access.gettingstarted
Joan Wild
external usenet poster
 
Posts: 642
Default Grouping & Counting on a Field

Base your report on a Query. In design view of the query, choose View,
Totals.

GroupBy Department, Count Reports.


--
Joan Wild
Microsoft Access MVP

SkyGuy wrote:
Hello,

I've created a query that list all Access Reports that were written
for various departments. The query works fine but is displaying
duplicate department names (one display for each Access Report
written for that department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob



  #8  
Old August 18th, 2006, 07:57 PM posted to microsoft.public.access.gettingstarted
SkyGuy
external usenet poster
 
Posts: 10
Default Grouping & Counting on a Field

Here's a copy of the query SQL:

SELECT Reports.[Report Name], Reports.[Date requested], Reports.Status,
Reports.Dept
FROM Reports
WHERE (((Reports.[Date requested]) Between #7/1/2005# And #6/30/2006#) AND
((Reports.Status)="implemented")) OR (((Reports.Status)="completed"))
ORDER BY Reports.Dept;

Hope this answers you question.

"Klatuu" wrote:

What is your query returning?
How do you know which reports are returned for a department?

"SkyGuy" wrote:

I'm sorry but my query is not returning a count of reports per department and
I'm don't know how to do that. Can I create the Count in the report instead
of the query?

"Klatuu" wrote:

If your query is returning the number of records, put a text box on the
report and bind it to the field in the query that returns that value.

"SkyGuy" wrote:

Wow...that was easy and worked perfectly. Thank you!
But how do I display the number of reports written (as shown in the example
below)? I tried using the Access Question Box to find the answer but had no
luck.

"Klatuu" wrote:

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

  #9  
Old August 18th, 2006, 09:38 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Grouping & Counting on a Field

Put a text box on your form to count them. I think the control source should
be:
=Count([ReportName])

"SkyGuy" wrote:

Here's a copy of the query SQL:

SELECT Reports.[Report Name], Reports.[Date requested], Reports.Status,
Reports.Dept
FROM Reports
WHERE (((Reports.[Date requested]) Between #7/1/2005# And #6/30/2006#) AND
((Reports.Status)="implemented")) OR (((Reports.Status)="completed"))
ORDER BY Reports.Dept;

Hope this answers you question.

"Klatuu" wrote:

What is your query returning?
How do you know which reports are returned for a department?

"SkyGuy" wrote:

I'm sorry but my query is not returning a count of reports per department and
I'm don't know how to do that. Can I create the Count in the report instead
of the query?

"Klatuu" wrote:

If your query is returning the number of records, put a text box on the
report and bind it to the field in the query that returns that value.

"SkyGuy" wrote:

Wow...that was easy and worked perfectly. Thank you!
But how do I display the number of reports written (as shown in the example
below)? I tried using the Access Question Box to find the answer but had no
luck.

"Klatuu" wrote:

Set the Hide Duplicates property for the text box that displays the
department to True. It will then show only the first occurance for each.

"SkyGuy" wrote:

Hello,

I've created a query that list all Access Reports that were written for
various departments. The query works fine but is displaying duplicate
department names (one display for each Access Report written for that
department).

I'd like to display the results (w/o duplicate department names) in an
Access Report as follows:

DEPARTMENT NUMBER OF REPORTS WRITTEN
HR 10
Payroll 21
Accounting 35

Please advise and thank you in advance,
Bob

 




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 12:56 AM.


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