Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Select Record Parameter and Wildcard Post Reply Post New Topic
Author Message
tdavenport
Groupie
Groupie
Avatar

Joined: 21 Oct 2008
Location: United States
Online Status: Offline
Posts: 41
Quote tdavenport Replybullet Topic: Select Record Parameter and Wildcard
     Posted: 05 Nov 2012 at 6:34am
I've done this before but I think I'm suffering from a senior moment.

I have a parameter with 5 string values and 1 'All'.

If the parameter = ' All ' then all values are returned. If a specific parameter is selected I need to select all values that are 'LIKE' the parameter. When I select 'All' it works. But when I select any of the other values (such as 'Adobe') then I get no results. I know this is a syntax error but I can't figure out what I've done. My Record selection formula is as follows:

If {?Focus on Specific SW Publisher or show all} <> 'All'
Then {Command.Publisher} like {?Focus on Specific SW Publisher or show all}
Else {Command.Publisher} like '*'

Again, if I select 'All' then I get my results. If I select any other value then I get no results. What, pray tell, am I doing wrong? I've tried to put Asterisks in front and behind my parameter and put them in quotations but to no avail.

Thank you!
Any and all suggestions are welcome.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Nov 2012 at 8:02am
(?Focus on Specific SW Publisher or show all} = 'All'
or
{Command.Publisher} like {?Focus on Specific SW Publisher or show all} + '*')
 
 
you can also use startswith instead of like if you wanted to here.


Edited by DBlank - 05 Nov 2012 at 8:02am
IP IP Logged
tdavenport
Groupie
Groupie
Avatar

Joined: 21 Oct 2008
Location: United States
Online Status: Offline
Posts: 41
Quote tdavenport Replybullet Posted: 05 Nov 2012 at 8:13am
+'*'

That did it. I can't believe I didn't catch that. Thank you, DBlank, as always!
Any and all suggestions are welcome.
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