Calls Answered Within x Minutes

Version 1
    This document was generated from CDN thread

    Created by: Shane DAgostino on 11-09-2012 09:04:10 AM
    I'm trying to add two custom fields in a Skill Group Historical Report. In this report, I'd like to be able to include a count of the calls where answered within 2 Minutes and 5 minutes. Here's the SQL I've tried, but it is producing an error. Can anyone help me with the correct query to create this field?
    CallsLessThan2 = Sum(case when ISNULL(SGHH.AnswerWaitTime, 0) <= 120 then 1 else 0 end),
    CallsLessThan5 = Sum(case when ISNULL(SGHH.AnswerWaitTime, 0) <= 300 then 1 else 0 end)