Count Problems

W

WMorsberger

I have the following query set up - now i know that it is not a normalized
database but this is what I have to work with and hopefully I can get what I
need to work.

SELECT tblRR.ID, tblRR.Date, tblRR.RerouteContact, tblRR.ContactName,
tblRR.Name, tblRR.Address, tblRR.MCSNumber, tblRR.Acct1, tblRR.Acct2,
tblRR.Acct3, tblRR.Acct4, tblRR.Acct5, tblRR.Acct6, tblRR.Acct7, tblRR.Acct8,
tblRR.Acct9, tblRR.Acct10, tblRR.Acct11, tblRR.Acct12, tblRR.Acct13,
tblRR.Acct14, tblRR.Acct15, tblRR.Acct16, tblRR.Acct17, tblRR.Acct18,
tblRR.Acct19, tblRR.Acct20, tblRR.DateRecdBack, tblRR.FirstAttptFollowupDate,
tblRR.SecondAttptFollowupDate, tblRR.ThirdAttptFollowupDate,
tblRR.DaysOutOfCompliance,
Sum(-IsNull([Acct1])-IsNull([Acct2])-IsNull([Acct3])-IsNull([Acct4])-IsNull([Acct5])-IsNull([Acct6])-IsNull([Acct7])-IsNull([Acct8])-IsNull([Acct9])-IsNull([Acct10])-IsNull([Acct11])-IsNull([Acct12])-IsNull([Acct13])-IsNull([Acct14])-IsNull([Acct15])-IsNull([Acct16])-IsNull([Acct17])-IsNull([Acct18])-IsNull([Acct19])-IsNull([Acct20])) AS CountOfPieces
FROM tblRR;

When I try to run the query I am getting the following error message

"You tried to execute a query that does not include the specified expression
"ID" as part of an aggregate function"

Can someone please help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top