• I want to push my luck and add one more wrinkle. Say the Curr_Date column is DATETIME and the output of the MyAverage CTE express is grouped by HourOfDay like this:

    Curr_date HourOfDay Action Avg_Duration

    2013-03-29 07 SignOn 0.950123

    2013-03-29 07 GetBal 0.386373

    2013-03-29 08 SignOn 0.891234

    2013-03-29 08 GetlBal 0.423432

    2013-03-29 09 SignOn 0.912342

    2013-03-29 09 GetBal 0.372323

    And I need to sum those average durations within each hour. So the output would look like:

    Curr_date HourOfDay Action Avg_Duration SummedAverage

    2013-03-29 07 SignOn 0.950123 1.336496

    2013-03-29 07 GetBal 0.386373 1.336496

    2013-03-29 08 SignOn 0.891234 1.314666

    2013-03-29 08 GetlBal 0.423432 1.314666

    2013-03-29 09 SignOn 0.912342 1.284665

    2013-03-29 09 GetBal 0.372323 1.284665

    Any tricks you can show me there?