... count(DISTINCT det.meetingnumber) as CaseCounter ...>I'm using SQL Server 2000, and I thought I had this, but I was wrong, the following query returns everything I need with the exception of the casecounter. In the query below, I'm trying to return all the the items used by a physician grouping it by the procedure done and surgeon (here I'm limiting it to one for testing purposes) including returning the number of cases the data is pulled from (distinct meetingnumber). In my example, there should 5, my casecounter field is return various values on each record that range from 1 to 5. I'm assuming that it is returning how many cases that item was used on instead of the total of of procedures (of that type)for that surgeon.
>Procedure physician item casecnt >CABG DOCTOR A ITEM 1 5 >CABG DOCTOR A ITEM 2 5 ><snip>