• I agree about doing as much code as possible in the SQL directly

    Much like we call a histogram

    ex.

    SELECT COUNT(*)

    ,[BusRoute]

    ,[BusRouteDescription]

    FROM [ICES].[dbo].[CardAFCTransactionDetails]

    where BusRoute is not null and BusRoute > ' ' and RecordType <> 6

    group by [BusRoute]

    ,[BusRouteDescription]

    order by [BusRoute]

    ,[BusRouteDescription]