‎2011-10-21
03:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Using a Parameter in a LIKE Statement
Is there any way to use a parameter within a LIKE statement. For example: WHERE Message LIKE '%$(parameter)%' When I try this, I receive an error message because the $(parameter) is expanded to '$(parameter)', and the single quotes screws up the syntax. So, for example, if the parameter equals test, you end up getting: WHERE Message LIKE '%'test'%' which throws a syntax error. Thanks, Brian
2 Replies
‎2011-10-25
09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Yes, you can do this.
The trick is to type the wildcards in the prompt field when you actually run the report. In the Where Clause for your query, you would simply have: Message LIKE ${test}
When you run the report, you would enter %search string% in the input field.
The single quotes are assumed to exist, so you don't need to enter them in the Where Clause as part of the report template.
‎2011-10-25
03:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
That works - Thanks for the response!
