View Full Version : Problem in getting count of distinct values!!!!!


johnyjassi
07-04-2008, 09:29 AM
Hi all,

I have a query that is retrieving values from a table, the result of the query is
State RepCode Count
AB AA 3
AB AA 4
BC BB 2
BC BB 1

*Count is showing the number of sales by each sales person(RepCode), and is for two different companies. But i want the following result,a s it should show the number of different companies per Salesperson, not number of sales

State RepCode Count
AB AA 2
BC BB 2

Any help will be appreciated!!
Thanks in advance!

Brianwarnock
07-04-2008, 11:16 AM
Groupby Repcode Groupby State Count(*)

johnyjassi
07-04-2008, 12:06 PM
Thanks Brian, you are great. you have solved my problem. Thanks a lot.