Home Forums SQL Server 2008 SQL Server Newbies Coding Counts and Subtotals by day, location and grand totals in T-SQL RE: Coding Counts and Subtotals by day, location and grand totals in T-SQL

  • Randy:

    This is close but not quite. I need to show total cars/loads by day per location and then total cars/loads per location. See bold items below.

    Example:

    Location Date Car Net Tons

    Claremont HY 12/6 Car A 10

    12/6 Car B 16

    12/6 Car C 14

    Daily Totals 3 loads 40

    12/7 Car A 12

    12/7 Car B 16

    Daily Totals 2 Loads 28

    Location Totals 5 Loads 68

    Your code is very helpful for getting totals (car/loads) by date but I need sums/totals by location.