Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: formula help!!!!! Post Reply Post New Topic
Author Message
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Topic: formula help!!!!!
     Posted: 18 May 2012 at 8:44am
 have a simple report in which i need crystal rpt to evaluate if any of the field values are 2 or 3 then leave then show the row
 
my report is grouped by clientid
to display the most recent assessment i moved all my fields to the group footer
 
my fields (70 of them) display a value of 0,1,2,or 3
 
what i need to do is display any client that has any of those fields answered with a 2 or 3
 
i tried the select expert i selected each field and said is one of 2 or 3 but that did not work because it will only give me all the clients whom have 2 or 3 only in all fields
 
suggestions??
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 18 May 2012 at 10:14am

you could try to use
or in select expert like
(
table.field1 in [ 2,3] or
table.field2 in [ 2,3] or
table.field3 in [ 2,3] or
table.field4 in [ 2,3] or
table.field5 in [ 2,3] or ...
)



IP IP Logged
dbodell
Groupie
Groupie
Avatar

Joined: 08 Nov 2011
Location: United States
Online Status: Offline
Posts: 53
Quote dbodell Replybullet Posted: 18 May 2012 at 11:16am
You could write a stored procedure and do the selection in SQL, or another idea is to concatenate the values of the 70 fields into one formula field and then use the LIKE function to see if there is a 2 or a 3 in the formula field...
{FORMULAFIELD} LIKE "*2*" OR {FORMULAFIELD} LIKE "*3*"
(Not a pleasant solution with 70 fields, but it would work and would be faster than checking each field individually),
or you could create an array out of your fields and use IN to check the values in the array:
3 in[{field01},{field02},....{field70}]. I think that might work...
 


Edited by dbodell - 18 May 2012 at 11:21am
Thanks,
D. Bodell
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