robman70
Technical User
- Aug 6, 2002
- 90
I'm working with mssql 2000 and vb, i have an sql statement:
and this works great, the problem is that i need one more column from the table, so i changed the query to
but now i get a message saying 'Column "Quotes.QuoteID" is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.' Fine, I stuck it in the group clause but now my results are all messed up. How can i get whats in the QuoteID column without messing up the results of the query. Thanks in advance...
Code:
select OCity, OState, OZip From Quotes GROUP BY OCity, OState, OZip ORDER BY OCity, OState, OZip
Code:
select QuoteID, OCity, OState, OZip From Quotes GROUP BY OCity, OState, OZip ORDER BY OCity, OState, OZip