Welcome to MSDN Blogs Sign in | Join | Help

How to use "Like" operator in the QueryBuildRange.Value

To make something as the "LIKE" operator in a query,  you should just assign a value to the queryRange including a wildcard.

The query framework will then change the statement into a LIKE statement. If the value does not contain a wildchard the query framework will change the statement to ==.

Example:

static void QueryBuildRange_Like(Args _args)
{
    Query                   query = new Query();
    QueryRun                queryRun;
    QueryBuildDataSource    queryDataSource;
    QueryBuildRange         queryRange;
    CustTable               custTable;
    ;

    queryDataSource = query.addDataSource(tablenum(CustTable));

    queryRange = queryDataSource.addRange(fieldnum(CustTable, Name));
 
    queryRange.value('The*');
 
    queryRun = new QueryRun(query);
    while (queryRun.next())
    {
        custTable = queryRun.get(tablenum(CustTable));
        info (custTable.Name);
    }
}


This posting is provided "AS IS" with no warranties, and confers no rights.

Published Thursday, February 16, 2006 3:01 PM by Palle Agermark
Filed under:

Comments

New Comments to this post are disabled
 
Page view tracker