Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

distinct count not distincting... 1

Status
Not open for further replies.

pbateman

Programmer
Jul 6, 2004
58
GB
Anybody got any clues as to why:

select distinct count (a.serv_dept_id) as Number_of_Teams, a.incident_id
from
act_reg a
group by
a.incident_id

is ignoring the 'distinct' bit and behaving as a normal 'count'?

Am reporting against an sql server db and using crystal 10 (not that either of those things should make a difference with something so simple).
 
try

select count (distinct a.serv_dept_id) as Number_of_Teams, a.incident_id
from
act_reg a
group by
a.incident_id


Mo
 
Thank you. The one variation I didn't try, and would never have thought of....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top