Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Problem with Select Expert Post Reply Post New Topic
Author Message
ScottWalker
Newbie
Newbie
Avatar

Joined: 11 Sep 2009
Location: United States
Online Status: Offline
Posts: 2
Quote ScottWalker Replybullet Topic: Problem with Select Expert
     Posted: 11 Sep 2009 at 10:17am
All,
 
Having an issue with using the Select Expert to filter a report.
I'm using crystal reports 2008.  My statement is :
 
{Enc.HspFlg} = "Y" and
{Enc.BegDat} <= DateTime (2009, 05, 31, 00, 00, 00) and
{Enc.OrgSys} = 70 and
{Adm.AdmSts} = "Y" and
{Enc.EndDat} > DateTime (2009, 05, 01, 00, 00, 00)
or
IsNull ({Enc.EndDat})
 
The problem is with the IsNull - mainly i believe is because i'm already
filtering on the Enc.EndDat field.  I tried putting () around each section, but
that didn't help. The first "group" in the maroon color works fine.
But when i add the last part (in blue) it scrubs everything.
 
Any suggestions ?
 
Thanks
Scott
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Sep 2009 at 10:36am
I can swear that for some reason that putting the ISNULL first impacts the statement although i don't think it should. You also need parenth around the the isull or end> part ...try....
(
IsNull ({Enc.EndDat})
or
{Enc.EndDat} > DateTime (2009, 05, 01, 00, 00, 00)
) and
{Enc.HspFlg} = "Y" and
{Enc.BegDat} <= DateTime (2009, 05, 31, 00, 00, 00) and
{Enc.OrgSys} = 70 and
{Adm.AdmSts} = "Y"
 


Edited by DBlank - 11 Sep 2009 at 10:37am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Sep 2009 at 10:41am
Actually I am curious if you don't mind testing....
If the above works for you, do you get the same/correct results with inverting the OR statement (below) or does it omit the NULL enddat records...
(
{Enc.EndDat} > DateTime (2009, 05, 01, 00, 00, 00)
or
IsNull ({Enc.EndDat})
) and
{Enc.HspFlg} = "Y" and
{Enc.BegDat} <= DateTime (2009, 05, 31, 00, 00, 00) and
{Enc.OrgSys} = 70 and
{Adm.AdmSts} = "Y"
 


Edited by DBlank - 11 Sep 2009 at 10:42am
IP IP Logged
ScottWalker
Newbie
Newbie
Avatar

Joined: 11 Sep 2009
Location: United States
Online Status: Offline
Posts: 2
Quote ScottWalker Replybullet Posted: 11 Sep 2009 at 11:44am
Thanks DBlank !
That worked.
 
And I did test by inverting the OR statement like you asked.
It did drop the Null records.
 
Thanks Again !
 
scott
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Sep 2009 at 11:55am
Thanks for verifying!
 
I can't figure why it ignores the "or ISNULL()" if you put it second....
Only thin I can think of is it already made it dropped the nulls in order to check the value so when it reevaluates the NULLS were already excluded...
anyone else know about this?
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