Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Leading % wildcard in my criteria parameter

edited June 2007 in General
Using Delphi 7 and 10.06 Enterprise

In RAP I use TdaCriteria to create an search criteria. In one of the
criteria I use the "LIKE" parameter. This produces SQL where my parameter
ends with a %. This is fine if my parameter need to match the first part of
a word. What I need is to match any part of a word so I need both leading
and trailing % wildcards.

EG, %text%

Is there anyway to get this desired functionality or do I need to manually
add the leading % wildcard to my criteria parameter ?

Ian Munro

Comments

  • edited June 2007
    Hi Ian,

    When creating the search criteria, try adding the wildcard characters in
    your self (%text%). In my testing with the Query Designer, this seemed to
    work correctly.

    I would also recommend using the TdaSQLBuilder object to create and alter
    the Search Criteria of a Query from RAP. Something like the following...

    lSQLBuilder.SearchCriteria.AddAutoSearch('Customer', 'Company', 'Like',
    '%Text%');

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2007
    Hi,

    What you suggested is what I am now doing. I wasn't sure is there was a
    flag or parameter I could set to get Report Builder to do it for me. I'm
    happy to add the wildcards manually.

    Thanks for the quick response.

    Ian

This discussion has been closed.