• Try this

    select SUM(CASE WHEN SCM_EMAIL_ANSWER_FACT.QUEST_ANSWER IN ('1','2') THEN 100 ELSE 0 END) / COUNT (*)

    from SCM_EMAIL_CONTROL

    inner join cli_email_rec on [SCM_EMAIL_CONTROL].RESPONDENT_ID = cli_email_rec.RESPONDENT_ID

    inner join SCM_EMAIL_ANSWER_FACT on CLI_EMAIL_REC.RESPONDENT_ID = SCM_EMAIL_ANSWER_FACT.RESPONDENT_ID

    where

    SCM_EMAIL_CONTROL.PGM_CD = '123'

    and SCM_EMAIL_CONTROL.DISP_CD = 'CMP'

    and convert(date,SCM_EMAIL_CONTROL.LAST_VISIT_DATE) between '2012-07-01' and '2012-09-30'

    --and CLI_EMAIL_REC.Survey_Type = 'Defector'

    and SCM_EMAIL_ANSWER_FACT.QUESTION_NUM in ('Q4_16')

    and (SCM_EMAIL_ANSWER_FACT.QUEST_ANSWER <> '0' );

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537