Author |
Message |
MartinHalford
Newbie
Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
|
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 Logged |
|
niha
Newbie
Joined: 05 Jun 2015
Online Status: Offline
Posts: 28
|
Posted: 29 Jun 2015 at 10:39pm |
you can use like
LIKE 'V7331_%' it may help you.
|
IP Logged |
|
MartinHalford
Newbie
Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
|
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 Logged |
|
kurt
Newbie
Joined: 08 Sep 2014
Online Status: Offline
Posts: 22
|
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 Logged |
|
MartinHalford
Newbie
Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
|
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 Logged |
|
MartinHalford
Newbie
Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
|
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 Logged |
|
MartinHalford
Newbie
Joined: 13 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 19
|
Posted: 30 Jun 2015 at 9:01pm |
New thread started under 'Extracting strings from Array in Subreport'
|
Thanks!
|
IP Logged |
|
|