We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: All Surveys for Dates


This report shows all surveys and status and results by date.

A sample image of this SQL report run in the Database Viewer is shown below:




To highlight and copy the code below to your clipboard, simply click the Copy button.

select patno, fname, lname, birthdat, cast(quest_result_header.admin_date as date) as qdate1, quest_questionnaire_header.title as title1,
 quest_result_header.score as score1, quest_result_header.result_alpha, result_abnormal, c.descript as stage
from register
left outer join quest_result_header on quest_result_header.patno = register.patno
inner join quest_questionnaire_header on quest_questionnaire_header.questionhead_id =  quest_result_header.questionhead_id
inner join (select * from code_table where group_id = 3) c on c.ref_id = quest_result_header.stage
where admin_date  between :start_date and :end_date
order by patno, qdate1 desc