I am wondering if there is a way to get single value back from a query if the query is a group by query.
For instance, if I do a query like:
select count(*), types from cars
I know I will get a single value back like 1345 rows.
But, if I do a group by I will get a whole recordset back of cars. I just wnat to know how many rows would have come back. I building a Sql Reporting Services Report and need to provide a total at the bottom of the report. The count can only come by doing a query with a group by in it.
Microsoft SQL Server 2005Microsoft SQL Server 2008Microsoft SQL Server
My original query looks more like this. It comes back with a bunch of rows obviously.
Select HistoryDetails.HistoryID, HistoryDetails.PartID, History.status, from HistoryDetails, history where HistoryDetails.Type = 'QUO'
and HistoryDetails.Dated between '02/01/09 12:00 AM' and '02/28/09 11:59 PM'
and HistoryDetails.historyid = history.historyid