insert into #variables.tableprefix#survey_emailaddresses(surveyidfk,emailaddress) values(, ) insert into #variables.tableprefix#surveys(id,name,description,active,datebegin,dateend,resultmailto,surveypassword,thankyoumsg) values( , , , , , null, , null, , , ) select id from #variables.tableprefix#questions where surveyidfk = delete from #variables.tableprefix#results where questionidfk in () delete from #variables.tableprefix#survey_results where surveyidfk = insert into #variables.tableprefix#survey_results(surveyidfk,ownerid,completed) values( , , ) The survey, #survey.name#, was just completed. The survey was completed at #dateFormat(now(),"m/dd/yy")# at #timeFormat(now(),"h:mm tt")# Owner Key: #arguments.ownerid# ------------------------------------------------- Q#currentRow#) #questions.question# A) #getAnswerResult(questions.id,arguments.ownerid)# delete from #variables.tableprefix#survey_results where surveyidfk = delete from #variables.tableprefix#surveys where id = select answeridfk, truefalse, textbox, textboxmulti, other, itemidfk, owneridfk from #variables.tableprefix#results where questionidfk = select answeridfk, truefalse, textbox, textboxmulti, other, itemidfk from ptr where owneridfk = select answeridfk, truefalse, textbox, textboxmulti, other, itemidfk from results where questionidfk = and owneridfk = ---> select answer from #variables.tableprefix#answers where questionidfk = and id = select answer from #variables.tableprefix#answers where questionidfk = and id = select emailaddress from #variables.tableprefix#survey_emailaddresses where surveyidfk = select count(surveyidfk) as totalresults, min(completed) as firstResult, max(completed) as lastResult from #variables.tableprefix#survey_results where surveyidfk = select id, name, description, active, datebegin, dateend, resultmailto, surveypassword, thankyoumsg from #variables.tableprefix#surveys where id = select id, name, description, active, datebegin, dateend, resultmailto, surveypassword, thankyoumsg from #variables.tableprefix#surveys where active = 1 and (datebegin is null or datebegin < ) and (dateend is null or dateend > ) select max(rank) as highest from #variables.tableprefix#questions where surveyidfk = delete from #variables.tableprefix#survey_emailaddresses where surveyidfk = select surveyidfk from #variables.tableprefix#survey_results where surveyidfk = and ownerid = update #variables.tableprefix#surveys set name = , description = , active = , datebegin = , datebegin = null, dateend = , dateend = null, resultmailto = , surveypassword = , thankyoumsg = where id =