tnguyen315
MIS
Hello I have a crystal report XI with a record selection formula like this:
(
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBHFILE.PATIENT_TYPE} in ["3","4","5"]) and
({@TBZone} = {?Zone})
)
OR
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBDFILE.DIRECTLY_OBSERVED} in ["1","2"]) and
({ITBHFILE.PATIENT_TYPE} in ["1","2"]) and
({@TBZone} = {?Zone})
)
)
I suppose I have 52 records without duplicate, however based on the formula above I have 66 records with some of it have duplicate more than 1 on the first part if ({ITBHFILE.PATIENT_TYPE} in ["3","4","5"]) and have ({ITBHFILE.PATIENT_TYPE} in ["1","2"]) in both 1 and 2, that's why it had duplicate records.
Based on the formula above I have 47 records on the first part (instead of 33) and 19 records on the second part (which is right)
However, if I run only first part or second part seperately then I have correct result
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBHFILE.PATIENT_TYPE} in ["3","4","5"]) and
({@TBZone} = {?Zone})
)
I have 33 records on this formula
Second part I have 19 records.
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBDFILE.DIRECTLY_OBSERVED} in ["1","2"]) and
({ITBHFILE.PATIENT_TYPE} in ["1","2"]) and
({@TBZone} = {?Zone})
)
So please help, I'm very appreciated. I don't know what's wrong when combining all 2 parts together.
Thanks in advance.
(
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBHFILE.PATIENT_TYPE} in ["3","4","5"]) and
({@TBZone} = {?Zone})
)
OR
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBDFILE.DIRECTLY_OBSERVED} in ["1","2"]) and
({ITBHFILE.PATIENT_TYPE} in ["1","2"]) and
({@TBZone} = {?Zone})
)
)
I suppose I have 52 records without duplicate, however based on the formula above I have 66 records with some of it have duplicate more than 1 on the first part if ({ITBHFILE.PATIENT_TYPE} in ["3","4","5"]) and have ({ITBHFILE.PATIENT_TYPE} in ["1","2"]) in both 1 and 2, that's why it had duplicate records.
Based on the formula above I have 47 records on the first part (instead of 33) and 19 records on the second part (which is right)
However, if I run only first part or second part seperately then I have correct result
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBHFILE.PATIENT_TYPE} in ["3","4","5"]) and
({@TBZone} = {?Zone})
)
I have 33 records on this formula
Second part I have 19 records.
(
(Isnull({ITBHFILE.CLOSE_DATE})) and
({@ClosedStatus} = true) and
({ITBDFILE.DIRECTLY_OBSERVED} in ["1","2"]) and
({ITBHFILE.PATIENT_TYPE} in ["1","2"]) and
({@TBZone} = {?Zone})
)
So please help, I'm very appreciated. I don't know what's wrong when combining all 2 parts together.
Thanks in advance.