i write a query like below:select TransactionNo,CustomerName,Date,LoanAmount,TotalAmount,DailyInterest,Sum(DailyInterest) as RecdInt from tblDailyReceipts where Date between '02-08-2010' and '30-08-2010' and TransactionNo='8' group by TransactionNo
but the below error was displayed.
Msg 8120, Level 16, State 1, Line 1
Column 'tblDailyReceipts.CustomerName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
pls anyone tell me the mistake and explain when this problem will occur.