Howdy, Stranger!

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

Categories

Help with Count statement

ITNewbieITNewbie Member Posts: 2
Hi

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
where
and ClientList.Appkey = Applist.Appkey
and Applist.Account = Accounts.AcctNo
group by acctno, billcode, acctname
Sign In or Register to comment.