I am trying to create mailing lable from three tables (member, claim, claimDetail) using CR V.7. Sample fields and data are listed below:
Member
======
memId Name Address Dob
----- ---- ------- ----
1 Mem1 Add1 Dob1
2 Mem2 Add2 Dob2
3 Mem3 Add3 Dob3
Claim
=====
claimId memId
------- -----
1 Mem3
2 Mem2
3 Mem3
4 Mem1
claimDetail
===========
claimId lineNumber procedureCode ProcedureDate
------- ---------- ------------- -------------
1 1 Proc_A Date1
1 2 Proc_B Date2
1 3 Proc_C Date3
2 1 Proc_B Date4
2 2 Proc_E Date5
3 1 Proc_C Date6
Report selection criteria is based on member's date of birth (Dob), procedureCode, and procedureDate. Assuming that I need to print all members' name and address for mailing lable except the member who received proc_A under procedureCode.
Assuming all Dob and procedureDate fall inside the selection range. For Mem3, my query returns 2 lines (one for proc_B and one for proc_C). I end up with two identical lables for Mem3. In fact, I should not have to generate any lable for Mem3 because of the presence of proc_A.
How should I write the query so that once proc_A is detected, other procedureCode for the same claim of the same member are ignored. Thank You very much!!
Member
======
memId Name Address Dob
----- ---- ------- ----
1 Mem1 Add1 Dob1
2 Mem2 Add2 Dob2
3 Mem3 Add3 Dob3
Claim
=====
claimId memId
------- -----
1 Mem3
2 Mem2
3 Mem3
4 Mem1
claimDetail
===========
claimId lineNumber procedureCode ProcedureDate
------- ---------- ------------- -------------
1 1 Proc_A Date1
1 2 Proc_B Date2
1 3 Proc_C Date3
2 1 Proc_B Date4
2 2 Proc_E Date5
3 1 Proc_C Date6
Report selection criteria is based on member's date of birth (Dob), procedureCode, and procedureDate. Assuming that I need to print all members' name and address for mailing lable except the member who received proc_A under procedureCode.
Assuming all Dob and procedureDate fall inside the selection range. For Mem3, my query returns 2 lines (one for proc_B and one for proc_C). I end up with two identical lables for Mem3. In fact, I should not have to generate any lable for Mem3 because of the presence of proc_A.
How should I write the query so that once proc_A is detected, other procedureCode for the same claim of the same member are ignored. Thank You very much!!