Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Parenthesis / Or Stmt Post Reply Post New Topic
Author Message
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Topic: Parenthesis / Or Stmt
    Posted: 07 Sep 2017 at 12:39pm
Wrote a report and just cannot for the life of me figure these parens out in order for all of this to work. It is all working 'except' the lines with my ** and I can't figure out what my problem is. Anyone??

(({Members.CGRPID} like {?Health Plan} and
{Members.CPLNTP} like {?LOB}) or
isnull({Members.MBRNO}))

and

{Members.CIPACD} like {?IPA} and
not ({AUTHS.Status} like ["Cancelled","Denied"]) and

**(({AUTHS.ExpirationDate} < {@StartDefaultDate} or
**not isnull({Members.TermDate})) and

({AUTHS.ReferralType} like ["HPC","DIA"] and
isnull ({V_SupplementalDataEndServiceDate.EndServiceDate}))

or

({AUTHS.ReferralType} like ["LTC", "PAL"]) and
isnull ({AUTHS.DischargeDate}))
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 07 Sep 2017 at 1:24pm
Well my experience with Crystal Reports says that that NOT is a function and should have it's argument in parenthesis.

...  (({AUTHS.ExpirationDate} < {@StartDefaultDate} or
not( isnull({Members.TermDate}))) and   ...
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 08 Sep 2017 at 4:48am
Good morning; Tried that addition and still not working. Thank you for your suggestion though.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 08 Sep 2017 at 5:00am
Further examination looks like you are missing a closing parenthesis .  I indented to make it easier to find missing parenthesis.

(
    (
        {Members.CGRPID} like {?Health Plan} and
        {Members.CPLNTP} like {?LOB}
    ) or
        isnull({Members.MBRNO})
)

and

{Members.CIPACD} like {?IPA} and
    not ({AUTHS.Status} like ["Cancelled","Denied"]) and

(
    (
        {AUTHS.ExpirationDate} < {@StartDefaultDate} or
        not(isnull({Members.TermDate}))
    )
    and
   
    ({AUTHS.ReferralType} like ["HPC","DIA"] and
    isnull ({V_SupplementalDataEndServiceDate.EndServiceDate})

    )

or

    (
        {AUTHS.ReferralType} like ["LTC", "PAL"]) and
        isnull ({AUTHS.DischargeDate})
    )
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 08 Sep 2017 at 5:06am
Hi there-yep, I tried exactly what you put in the 2nd response and that line is still not working. It's bringing back records that the expiration date is greater than the StartDefaultDate.

Example: one record has an expiration date of 11/6/2017 and my StartDefaultDate is today 09/08/2017.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Sep 2017 at 7:56am
and just to verify, those same records do not have any value in the Members.TermDate field?
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 08 Sep 2017 at 8:11am
That is correct. They do not have anything in the term date. Thank you again!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 08 Sep 2017 at 8:14am
Also with the OR this code would bring 'override' the code above it.

{AUTHS.ReferralType} like ["LTC", "PAL"]) and
        isnull ({AUTHS.DischargeDate})
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Sep 2017 at 8:16am
What Kevlray said :)
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 08 Sep 2017 at 8:17am
[IMG]smileys/smiley4.gif" align="middle" />


Ahhhh....got it. I need to move some things around and add that to the end maybe...will keep thinking about this and work on it.

Edited by BoltzGirl - 08 Sep 2017 at 8:18am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.