Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Restricting 'IN' statement returns Post Reply Post New Topic
Author Message
MartinHalford
Newbie
Newbie
Avatar

Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote MartinHalford Replybullet Topic: Restricting 'IN' statement returns
    Posted: 29 Jun 2015 at 2:37am
I am using an 'IN' statement to return a cluster of records in a subreport. The formula that I am passing to the subreport is created as a string in the main report. For example it could be "V7331_M25", "V7331_R67". My problem is that it selects everything that is contained in my data, even as substrings of my formula string. So in this example, I only want records for items "V7331_M25" and "V7331_R67", and not "V7331" (of which there are also multiple rows).

Is there a way of restricting the IN statement to return only those rows that have an exact match? It seems that the Crystal function automatically does a 'Like'.
Thanks!
IP IP Logged
niha
Newbie
Newbie
Avatar

Joined: 05 Jun 2015
Online Status: Offline
Posts: 28
Quote niha Replybullet Posted: 29 Jun 2015 at 10:39pm
you can use like
LIKE 'V7331_%' it may help you.
IP IP Logged
MartinHalford
Newbie
Newbie
Avatar

Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote MartinHalford Replybullet Posted: 29 Jun 2015 at 10:49pm
No, that was simply an example of the data that is being included incorrectly in my cluster of records returned.
Thanks!
IP IP Logged
kurt
Newbie
Newbie


Joined: 08 Sep 2014
Online Status: Offline
Posts: 22
Quote kurt Replybullet Posted: 30 Jun 2015 at 6:13am
Not much help, but I am having the same issue and reposted with my example, hopefully someone can help.
IP IP Logged
MartinHalford
Newbie
Newbie
Avatar

Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote MartinHalford Replybullet Posted: 30 Jun 2015 at 8:18am
Thankyou Kurt. I have since discovered that what I am returning is an array, and trying to convert this into individual strings will, I believe, give me a solution, since then I can do in my selection formula ((field="X") OR (Field="Y")) but doing that conversion is proving difficult.

Essentially though I think the CR 'IN' statement does much the same as an SQL 'LIKE' statement. Not good!
Thanks!
IP IP Logged
MartinHalford
Newbie
Newbie
Avatar

Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote MartinHalford Replybullet Posted: 30 Jun 2015 at 8:19am
Thankyou Kurt. I have since discovered that what I am returning is an array, and trying to convert this into individual strings will, I believe, give me a solution, since then I can do in my selection formula ((field="X") OR (Field="Y")) but doing that conversion is proving difficult. Essentially though I think the CR 'IN' statement does much the same as an SQL 'LIKE' statement. Not good!
Thanks!
IP IP Logged
MartinHalford
Newbie
Newbie
Avatar

Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote MartinHalford Replybullet Posted: 30 Jun 2015 at 9:01pm
New thread started under 'Extracting strings from Array in Subreport'
Thanks!
IP IP Logged
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.