Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: query/formula with parameters Post Reply Post New Topic
Author Message
dennis0027
Newbie
Newbie


Joined: 06 Jun 2011
Online Status: Offline
Posts: 2
Quote dennis0027 Replybullet Topic: query/formula with parameters
     Posted: 07 Jun 2011 at 5:04am

Just Crystal Report XI and SQL (No VB or C#). Please bear with me since I am kinda new to CR.

Please note the questions below are not related.

Thanks in advance for the help.

 

1.       In a CR embedded query (command in Database Expert), how to convert a SQL query

Select * from table1 a where (a.col1 like ‘%str1%’ or a.col1 like ‘%str2%’ …)

to a CR SQL query with a parameter (multiple values)

Select * from table1 a where a.col1 like {?Str} – incorrect, please provide the correct one.

For instance, rows with col1 values = ‘a,b,c’ and ‘d,e,f,’ are selected when  the values of parameter {?Str} are ‘b’ and ’e,’

 

2.       In the Selection Expert, a formula looks like “table1.col1 like {?Str}”. Have to enter ‘*a*’ in the parameter to find all rows containing ‘a’ in the col1 (similar to “like ‘%a%’” in SQL). What would be the correct formula if I don’t want to have enter ‘*’ in front and after ‘a’ in the parameter?

 

3.       CR getting dataset from a SQL stored procedure. How to pass parameter values to the stored procedure? One values per parameter? Multiple values per parameter?

 

Dennis

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