When emailing out a survey, there will be parameters for who you will be targeting.
These bits of code will help narrow the list down by a set of criteria –
Date based parameter
AND datediff(dd,CONVERT (date, SentDate), CONVERT (date, GETDATE()))=5
This code will target anyone with a SentDate (Field in the survey) 5 days ago, change this time to target X days ago.
Status based – One filter
Status field – =’Active’
This will target any row with a status of Active
Status based – More than one filter