Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    2

    Question Unanswered: WHERE field is like % parameter % ??

    I am putting this phrase into Crystal 8.5. It essentially says

    WHERE FIELDA is like '%{paramater_name}%'

    How do I write this without {parameter_name} being looked at literally?

    Thank you so much!

  2. #2
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by kcampbell9
    WHERE FIELDA is like '%{parameter_name}%'
    How do I write this without {parameter_name} being looked at literally?
    I would try to put the "%" inside the parameter value.
    Then you should be able to write something like
    Code:
    WHERE FIELDA is like :parameter_name
    (I don't know about Crystal Reports' specific syntax; this is generic SQL.)
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Although I have never used Crystal Reports, I thought that you might try to concatenate % with a parameter; in Oracle, double pipe sign is used for concatenation. It would look like this:
    Code:
    WHERE fielda LIKE '%' || parameter_name || '%'
    Maybe you can do something like this in Crystal Reports too.

  4. #4
    Join Date
    Feb 2007
    Posts
    2
    Quote Originally Posted by Littlefoot
    Although I have never used Crystal Reports, I thought that you might try to concatenate % with a parameter; in Oracle, double pipe sign is used for concatenation. It would look like this:
    Code:
    WHERE fielda LIKE '%' || parameter_name || '%'
    Maybe you can do something like this in Crystal Reports too.
    This is what I am trying. One more question.... how do I use quotes the formula? ''' doesn't quite work.... Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •