Parenthesis / Or Stmt
Printed From: Crystal Reports Book — Forum Name: Technical Questions
Posted By: BoltzGirl — 7 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}))
Posted By: kevlray — 7 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 ...
Posted By: BoltzGirl — 8 Sep 2017 at 4:48am
Good morning; Tried that addition and still not working. Thank you for your suggestion though.
Posted By: kevlray — 8 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}) )
Posted By: BoltzGirl — 8 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.
Posted By: DBlank — 8 Sep 2017 at 7:56am
and just to verify, those same records do not have any value in the Members.TermDate field?
Posted By: BoltzGirl — 8 Sep 2017 at 8:11am
That is correct. They do not have anything in the term date. Thank you again!
Posted By: kevlray — 8 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})
Posted By: DBlank — 8 Sep 2017 at 8:16am
What Kevlray said :)
Posted By: BoltzGirl — 8 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
|