SQL Aggregate Function Error
Posted on 2011-05-12
I am at a loss with this one.
Column 'StockQuoteHeader.SQHQuoteID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
I want to Group By Sales and the order by date.
"Select Distinct SQHQuoteID, Count(SQHQuoteID), SQHTotalDollar, SQHFollowUpComments, SQHCustomerName, SQHCustomYes, SQHEndUserName, SQHContactName, SQHCreatorUsername, SQHCreatorDateTime, SQHRegion, SQHSalesPerson from StockQuoteHeader where SQHWonLostOpen='Open' and SQHStatusCode='35' group by SQHSalesperson order by SQHCreatorDateTime desc "