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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count Group By



 
 
Thread Tools Display Modes
  #1  
Old May 26th, 2004, 08:16 PM
Patrick
external usenet poster
 
Posts: n/a
Default Count Group By

I have a table of transactions for multiple iterations of the same policy number. The Group By function works to LIST the distinct policy numbers, but how do I COUNT those "grouped" policy numbers to show results below?
The "kicker" is I'd like to use the query design view in Access (not paste and copy SQL)...
e.g.
trans 1, policy number abc
trans 2, policy number abc
trans 1, policy number xyz
Results = 2 Policy numbers (not 3)
  #2  
Old May 26th, 2004, 08:29 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default Count Group By

In Query Design, select View Totals. Set the Policy Number to Count

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Patrick" wrote in message
...
I have a table of transactions for multiple iterations of the same policy

number. The Group By function works to LIST the distinct policy numbers,
but how do I COUNT those "grouped" policy numbers to show results below?
The "kicker" is I'd like to use the query design view in Access (not paste

and copy SQL)...
e.g.
trans 1, policy number abc
trans 2, policy number abc
trans 1, policy number xyz
Results = 2 Policy numbers (not 3)



  #3  
Old May 26th, 2004, 08:55 PM
Michel Walsh
external usenet poster
 
Posts: n/a
Default Count Group By

Hi,



Make first a saved query, q1, out of your GROUP BY query, then, make a
second query:

SELECT COUNT(*)
FROM q1



You just count the number of records returned by the first query, which is
what it seems you seek.

Hoping it may help,
Vanderghast, Access MVP





"Patrick" wrote in message
...
I have a table of transactions for multiple iterations of the same policy

number. The Group By function works to LIST the distinct policy numbers,
but how do I COUNT those "grouped" policy numbers to show results below?
The "kicker" is I'd like to use the query design view in Access (not paste

and copy SQL)...
e.g.
trans 1, policy number abc
trans 2, policy number abc
trans 1, policy number xyz
Results = 2 Policy numbers (not 3)



 




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:22 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.