Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record Selection Formula ignoring the last conditi Post Reply Post New Topic
Author Message
Sunapee
Newbie
Newbie


Joined: 09 Apr 2010
Online Status: Offline
Posts: 5
Quote Sunapee Replybullet Topic: Record Selection Formula ignoring the last conditi
     Posted: 15 Jul 2010 at 7:40am
Crystal Reports 2008.

I am using the following Record Selection Formula that has 4 qualifiers:

{Status.sStatus} = "Active" and

(if not hasvalue({?Subject Keyword}) then 1=1 else instr({Bug.sTitle},{?Subject Keyword},1) > 0 ) and

(if not HasValue({?Entered by}) then 1=1 else {@Entered By} = {?Entered by}) and

(if not HasValue({?Application}) then 1=1 else {Project.ixProject} = {?Application})

For some reason, the last qualifier is being ignored.  Switching their sequence always results in the last one being ignored.  Something in the back of my mind tells me that I have seen this on previous version(s) of CRW, but I am not recalling any details.



Edited by Sunapee - 15 Jul 2010 at 7:41am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Jul 2010 at 9:22am
not familiar with 2008 or the hasvalue for empty params but NULLS always had to be evaulated first in earlier versions as the formula died on a NULL. Perhaps the HasValue is a similar process?
Also try and stay away from IF-THENs in your select statement.
I would try something like:
 
{Status.sStatus} = "Active"
and
(not hasvalue({?Subject Keyword}) or instr({Bug.sTitle},{?Subject Keyword},1) > 0 )
and
(not HasValue({?Entered by}) or {@Entered By} = {?Entered by})
and
(not HasValue({?Application}) or {Project.ixProject} = {?Application})
IP IP Logged
Sunapee
Newbie
Newbie


Joined: 09 Apr 2010
Online Status: Offline
Posts: 5
Quote Sunapee Replybullet Posted: 15 Jul 2010 at 10:58am
Thanks for the reply.  Now that I read the wordd, I do remember that it was an issue with nulls in prior versions.

I'll test your suggestion tomorrow.
IP IP Logged
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