Survey Report Help

Survey Report Help

I get a report weekly (query below) of survey responses for the last week. I need to edit this query to have all surveys from 2019-10-01 to 2020-04-25 in the same format. I cant seem to get it to pull the correct timeframe and i also don't know if i am pulling everything, or if some of these are archived. 

  1. SELECT wo.WORKORDERID AS "Request ID", 
  2. max(wo.TITLE) AS "Request Title", 
  3. max(aau.FIRST_NAME) AS "Requester", 
  4. max(ti.FIRST_NAME) AS "Technician",
  5. max(srcmt.COMMENTTEXT) AS "Comments", 
  6. longtodate(max(srm.SENDTIME)) AS "Survey Created Time", 
  7. max(srm.result) "%" FROM SurveyResponseRequestMapping srrm 
  8. INNER JOIN Survey_Response_Main srm ON srrm.RESPONSEID=srm.RESPONSEID 
  9. LEFT JOIN Survey_Response_Answer sra ON srm.RESPONSEID=sra.RESPONSEID 
  10. INNER JOIN Survey_Question sq ON sra.QUESID=sq.QUESID 
  11. LEFT JOIN Survey_Radio_Option sro ON sra.QUESID=sro.QUESID 
  12. LEFT JOIN Survey_Response_Comment srcmt ON sra.RESPONSEID=srcmt.RESPONSEID 
  13. LEFT JOIN Survey_Main smn ON srm.SURVEYID=smn.SURVEYID 
  14. LEFT JOIN WorkOrder wo ON srrm.WORKORDERID=wo.WORKORDERID 
  15. LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID 
  16. LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID 
  17. LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID 
  18. LEFT JOIN SDUser td ON wos.OWNERID=td.USERID 
  19. LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID 
  20. WHERE srm.SENDTIME >= <from_lastweek> AND srm.SENDTIME <= <to_lastweek>
  21. group by wo.WORKORDERID
  22. ORDER BY wo.WORKORDERID DESC

                  New to ADSelfService Plus?