range for query

static

void range_test(Args _args)

{

    Query                   Query;

    QueryRun                QueryRun;

    QueryBuildDataSource    qbr;

CustTable custtable;

   

//QueryBuildRange         qbr;

    Range                   range =

'den-000004';

   

int                     num;

    Query =

new Query();

    qbr = Query.addDataSource(

tableNum(CustTable));

    qbr.name(

"Customer");

    qbr.addRange(

fieldNum(CustTable, AccountNum)).value(strFmt('((%1.%2 == "%4") || (%1.%3 == "%4"))',

        qbr.name(),

       

fieldStr(CustTable, AccountNum),

       

fieldStr(CustTable, InvoiceAccount),

        range));

    info(Query.toString());

    QueryRun =

new QueryRun(Query);

   

while (QueryRun.next())

    {

        custtable = QueryRun.get(

tableNum(CustTable));

        info(custtable.AccountNum);

        num++;

       

       

if (num > 5)

           

break;

    }

}

原文地址:https://www.cnblogs.com/lingdanglfw/p/4811951.html