Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help with Like on text parameter in Record Select Post Reply Post New Topic
Author Message
donnatt
Newbie
Newbie
Avatar

Joined: 31 Jan 2012
Location: Canada
Online Status: Offline
Posts: 2
Quote donnatt Replybullet Topic: Help with Like on text parameter in Record Select
    Posted: 31 Jan 2012 at 5:01am
I have created a parameter field that is a string input by the user.
I want to select records based on a field containing the characters the user entered  in the parameter.
This is my formula in the record selection expert:
 
if(  {?PartNum} <> '') then
    {PART.ExternalNumber} like '({?PartNum})*'  
 
 
I'm not getting any records selected and when I show the SQL query it is actually using the text of ({?PartNum})* instead of the value that the user input.
 
How do I get the record selection to use the value that the user input?
 
 
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 31 Jan 2012 at 5:21am
try
if(  {?PartNum} <> "") then
    {PART.ExternalNumber} like "{?PartNum}*"
IP IP Logged
donnatt
Newbie
Newbie
Avatar

Joined: 31 Jan 2012
Location: Canada
Online Status: Offline
Posts: 2
Quote donnatt Replybullet Posted: 31 Jan 2012 at 5:28am
Show SQL Query still has
 
LIKE '{_PartNum}%'
 
with no records selected.
 
 
 
Found it!!!
 
("*"+{?PartNum}+"*")


Edited by donnatt - 31 Jan 2012 at 5:59am
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.031 seconds.