Help with Count statement


Im using SQL server and I have to create a report to find the # of tests for each client broken down by acctno and billing code. There are a total of 2,163 account numbers and billing codes. I wrote the query below, however, it is not giving me the correct solution. Any suggestions on how to make my count work? Thanks

SELECT DISTINCT Accounts.AcctNo, Clientlist.BillCode, Accounts.AcctName as Client,COUNT(TestResults.Appkey)
FROM Accounts, Clientlist, TestResults
and ClientList.Appkey = Applist.Appkey
and Applist.Account = Accounts.AcctNo
group by acctno, billcode, acctname
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!