PC Review


Reply
Thread Tools Rate Thread

Count Same Field

 
 
Bryan Hughes
Guest
Posts: n/a
 
      10th Nov 2003
Hello,

How do I design a query that counts different criteria number in a single
field?

I have a number field [CRE] that stores a corresponding number based on
client classification.

I need to make a query that will show the total number of 1, 2, 3 , 4 , 5
etc.

Example:

[CRE] = 1; TotalCount =5
[CRE] = 2; TotalCount = 10
[CRE] = 3; TotalCount =7
[CRE] = 4; TotalCount = 15
[CRE] = 5; TotalCount = 2

How can I make this work? It will go into a report.

-TFTH

-Bryan


 
Reply With Quote
 
 
 
 
John Viescas
Guest
Posts: n/a
 
      11th Nov 2003
Simple Totals query:

SELECT CRE, Count(CRE)
FROM MyTable
GROUP BY CRE

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
http://www.deanforamerica.com/site/T...090&px=1434411
"Bryan Hughes" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> How do I design a query that counts different criteria number in a single
> field?
>
> I have a number field [CRE] that stores a corresponding number based on
> client classification.
>
> I need to make a query that will show the total number of 1, 2, 3 , 4 , 5
> etc.
>
> Example:
>
> [CRE] = 1; TotalCount =5
> [CRE] = 2; TotalCount = 10
> [CRE] = 3; TotalCount =7
> [CRE] = 4; TotalCount = 15
> [CRE] = 5; TotalCount = 2
>
> How can I make this work? It will go into a report.
>
> -TFTH
>
> -Bryan
>
>



 
Reply With Quote
 
 
 
 
John Vinson
Guest
Posts: n/a
 
      11th Nov 2003
On Mon, 10 Nov 2003 12:33:11 -0800, "Bryan Hughes" <(E-Mail Removed)>
wrote:

>Hello,
>
>How do I design a query that counts different criteria number in a single
>field?
>
>I have a number field [CRE] that stores a corresponding number based on
>client classification.
>
>I need to make a query that will show the total number of 1, 2, 3 , 4 , 5
>etc.


Use a TOTALS query: create a query based on your table; select the
[CRE] field *twice*.

Change it to a Totals query by clicking the Greek Sigma icon (looks
like a sideways W); change the default Group By on the second instance
of GRE to Count. Base your report on this Query and you should be in
good shape!

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
count duplicats, display incremental count, restart count at changein value JenIT Microsoft Excel Programming 2 24th Aug 2010 09:10 PM
Count New to the List, Count Leaving the List, Count Total SteveC Microsoft Excel Misc 1 2nd Feb 2009 10:48 PM
Two sums on same field in same query based on second field criteri =?Utf-8?B?Q2FycGll?= Microsoft Access Queries 2 25th Jul 2007 04:32 PM
Update field value with same value in same field on previous row =?Utf-8?B?QmV0aA==?= Microsoft Access Queries 5 30th Oct 2006 04:26 AM
how to get count(col1), count(col2), count(sol3) with only one query Mario Krsnic Microsoft Access Queries 2 27th Oct 2006 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 AM.