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

  • One table showing details and the counts/sums/subtotals would be fine.

    We add html coding to the SQL script so the script output (report) can be displayed in a web browser. I am not worried about that piece as we have template code for that. I just want to show details for a location with the daily totals followed by the Location totals and Grand Totals at end of the report.

    I don't know how to get T-SQL to sum or count by day, then sum the counts or tons by location. Then sum all counts and sum Net Tons for all records in the date range specified.

    Hope this makes sense. Thanks.