Author |
Message |
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
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 Logged |
|
kostya1122
Senior Member
Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
|
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 Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
Posted: 30 Sep 2013 at 9:45am |
so {field} like ["1", "2", "3"] doesn't seem to do the trick
|
IP Logged |
|
kostya1122
Senior Member
Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
|
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 Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
bwsanders
Senior Member
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 01 Oct 2013 at 7:45am |
is this a part of a larger formula?
|
IP Logged |
|
|