PC Review


Reply
Thread Tools Rate Thread

Counting unique values and all values in same query

 
 
John Morrissey
Guest
Posts: n/a
 
      5th Aug 2004
I have a select query that is linked to a reference table
containing product names. The tables are linked by a
product code common to both tables; when it matches, the
table link populates the name of the product in the query.

The main table contains data lines by Account Number and
Cost Center fields as follows.
111 000
111 001
111 010
222 000
222 001
222 010

Using a form that is linked to this select query, I want
to count unique values of Account Number (2 instances, not
6) but I also want to count detail values of Cost Center
(6 instances, not 3.

 
Reply With Quote
 
 
 
 
Michel Walsh
Guest
Posts: n/a
 
      6th Aug 2004
Hi,


SELECT COUNT(*) FROM ( SELECT DISTINCT [Account Number] FROM myTable ) As x


and


SELECT COUNT(*) FROM ( SELECT DISTINCT [Cost Center] FROM myTable ) As x



Hoping it may help,
Vanderghast, Access MVP



"John Morrissey" <(E-Mail Removed)> wrote in message
news:0c0b01c47b21$98e10f00$(E-Mail Removed)...
> I have a select query that is linked to a reference table
> containing product names. The tables are linked by a
> product code common to both tables; when it matches, the
> table link populates the name of the product in the query.
>
> The main table contains data lines by Account Number and
> Cost Center fields as follows.
> 111 000
> 111 001
> 111 010
> 222 000
> 222 001
> 222 010
>
> Using a form that is linked to this select query, I want
> to count unique values of Account Number (2 instances, not
> 6) but I also want to count detail values of Cost Center
> (6 instances, not 3.
>



 
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
Counting unique values blswes Microsoft Excel Worksheet Functions 4 14th Aug 2008 06:50 PM
Counting Unique Values =?Utf-8?B?Y2FybA==?= Microsoft Excel Worksheet Functions 9 25th Jul 2005 12:44 PM
counting unique values in query Joe Microsoft Access Queries 6 23rd Mar 2005 02:31 PM
Counting Unique Values carl Microsoft Excel Worksheet Functions 2 27th May 2004 05:33 PM
Counting Unique Values NoviceUser Microsoft Access Reports 1 5th Mar 2004 10:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 PM.