I am trying to code to get the responses from a questionaire. I have to find people who based on previous questions who said "no" and and now on more recent questionaire said yes to same Question)Id. I have the tables matched to what they need but i am having problems with how to check the dates and see if it was no on first question_id and now with latest questionaire they said yes. Hope i explained this well enough.
Select * from table_a A
join table_q Q on q.quest_key = a.quest_key
join table_mbr M on m.ases_key = a.ases_key
join table_rspn R on r.mbr_rsp_key = m.mbr_rsp_key and r.ases_quest_key = q.ases_quest_key
WHERE r.rsp_txt = 'No' and to_date(datefield) ---this is where i am not sure what to do for comparing old date with no answer to yes with latest date?????????
and q.quest_id IN (22 quest_ids)
ANy help would be appreciated. Thanks.
Select * from table_a A
join table_q Q on q.quest_key = a.quest_key
join table_mbr M on m.ases_key = a.ases_key
join table_rspn R on r.mbr_rsp_key = m.mbr_rsp_key and r.ases_quest_key = q.ases_quest_key
WHERE r.rsp_txt = 'No' and to_date(datefield) ---this is where i am not sure what to do for comparing old date with no answer to yes with latest date?????????
and q.quest_id IN (22 quest_ids)
ANy help would be appreciated. Thanks.