Basically this is what I am trying to accomplish if it was just a straight query:
SELECT ar.acc_itn, ar.document_itn,
dx.document_itn, dx.read_dtime, dx.reading_dr, dx.pat_itn,
va.acc_itn, va.pat_itn, va.dept+va.proc_no,
vtas.acc_itn, vtas.stp_cd, vtas.stp_dtime
from activity_result ar, document_xref dx, visit_activity va, visit_trk_act_steps vtas
where ar.document_itn = dx.document_itn and
ar.acc_itn = va.acc_itn and
ar.acc_itn = vtas.acc_itn and
vtas.stp_cd = 8 and
vtas.acc_itn not in
*(select acc_itn from visit_trk_act_steps where stp_cd = 6 or stp_cd = 5 or stp_cd = 1)*
The code inside the ** I have in a subreport. I want to make the statement ' vtas.acc_itn not in' use the data returned by the subreport to compare to.
Can this be done? If so, does anyone have a coding sample to do this?