Search code examples
crystal-reportscrystal-reports-2008

Crystal Reports - Multiple Criteria for Same field


Here's what I'm looking to get accomplished. I have a report that I'm currently running and attempting to get data off of 3 distinct variables however 2 of the criteria expressions are pulling from the same column. When I run my report I'm not able to get information. Any suggestions? Thanks.

{HSP_ACCT_DX_LIST.DX_ID} in [3534, 3535, 3536, 3537, 3538, 3539]
and {HSP_ACCT_DX_LIST.DX_ID} in [9147, 9159, 9154, 9157]
and {HSP_ACCT_CPT_CODES.CPT_CODE} in [22804, 22802, 22843, 22844, 22848]

Solution

  • Your DX_ID can't simultaneously be in two disjoint sets. It would have to be in one or the other:

    {HSP_ACCT_DX_LIST.DX_ID} in [3534, 3535, 3536, 3537, 3538, 3539, 9147, 9159, 9154, 9157]
    and {HSP_ACCT_CPT_CODES.CPT_CODE} in [22804, 22802, 22843, 22844, 22848]
    

    EDIT:

    If you need to check a single account for the presence of multiple Dx, then you'll have to add a copy of the HSP_ACCT_DX_LIST table to your report which would be joined to the hospital account in the same way. Your record selection formula would then look like:

    {HSP_ACCT_DX_LIST_copy_1.DX_ID} in [3534, 3535, 3536, 3537, 3538, 3539]
    and {HSP_ACCT_DX_LIST_copy_2.DX_ID} in [9147, 9159, 9154, 9157]
    and {HSP_ACCT_CPT_CODES.CPT_CODE} in [22804, 22802, 22843, 22844, 22848]