Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: odd IN function Post Reply Post New Topic
Page  of 2 Next >>
Author Message
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Topic: odd IN function
    Posted: 30 Sep 2013 at 9:06am
i have this statement in my record select

{field} IN ["1", "2", "3"]

when i run my report records that i know have field = "2" show as zero and it's as if it doesn't even bring that record in at all. If instead i right

{field} = 2

then i get all of the correct fields and numbers that I am expecting. anyone run into this before?
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 30 Sep 2013 at 9:21am
yes, it happened to me too, some sort of crystal glitch.
so i changed it to "like" and it worked.
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 30 Sep 2013 at 9:45am
so {field} like ["1", "2", "3"] doesn't seem to do the trick
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 30 Sep 2013 at 10:55am
could it be that this is a very old report,
got corrupted or something, recreating it from scratch would probably fix it.
or you could always go with "or"
(
{field} = "2" or
{field} = "3"
)

IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 30 Sep 2013 at 10:59am
it's brand new. the only thing that I can think of is that it somehow got corrupted. I fear that I do have to re-create it. I can't think of any other way to correct the issue. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2013 at 3:59am

by your original post I assume this is a string field but one of the posts looks like it is numeric. If it is a string did you try and trim it?

trim({field}) IN ["1", "2", "3"]
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 01 Oct 2013 at 6:06am
@DB it is a string I was using that as an example. the actual code is

{labor.detcode} IN ["401k", "403M", "403B", "403S", "L403B"] and this returns all 0's but when i do 1 at a time i get real data and actual numbers.

it's really odd.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2013 at 7:29am

are y ou dealing with NULL in the fields at all?

if so use the option in the formual expert to flip it to use 'default values for null'
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 01 Oct 2013 at 7:38am
No null values in the field and by default I have crystal set to always use default values for null fields.  The only thing I can think of is some sort of glitch. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2013 at 7:45am
is this a part of a larger formula?
IP IP Logged
Page  of 2 Next >>
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.016 seconds.