Query to show the survey sent and received count( PGSQL & MSSQL )

Query to show the survey sent and received count( PGSQL & MSSQL )

Tested in Build PGSQL (14300) or MSSQL (14306)

Go To Reports- New Query Report and execute this query.

select adef.org_name "Account",count(srm.responseid) as "Total Survey Sent",count( CASE WHEN srm.responsetype!=3 then 1 ELSE NULL END) as "Total Survey received" from survey_response_main srm LEFT JOIN SurveyResponseRequestMapping srrm ON srm.responseid=srrm.responseid LEFT JOIN workorder wo ON wo.workorderid=srrm.workorderid LEFT JOIN accountsitemapping asm on asm.siteid=wo.siteid LEFT JOIN accountdefinition adef on adef.org_id=asm.accountid where wo.completedtime >= <from_thisyear> AND wo.completedtime <= <to_thisyear> and adef.org_id in ($Account) group by adef.org_name order by 1

                  New to ADSelfService Plus?