Selection question

  • What I've got is a large select query that I'm having a hard time modifying.

    One of the lines that is a portion of this select query is the following:

          , AnswerCount    = count(*)

    Now normally this works for everything I need to do, except in one instance (which I'm having to modify this query to be able to do) and in this instance what I need to have on this line is basically:

     

    , AnswerCount = count(*) where connecttime>0 and CRC<>'ANS'

    While being able to still maintain all the grouping options,etc that I have.

    I'm stumped though even though I'm sure there is an easy solution to this.

    Can anyone help please?

    Thanks much!

  • , SUM(CASE WHEN ConnectTime > 0 and CRC 'ANS' THEN 1 ELSE 0 END) as AnswerCount

  • Worked perfectly.  I knew it was simple, just was out of my grasp for the time being.  Thanks GREATLY Remi!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply