Use of query class

static void tutorial_VendTransCurYearQuery(Args _args)
{
    Query                   query = new Query();
    QueryBuildDataSource    qbdsVendTrans =
query.addDataSource(tableNum(VendTrans));
    QueryBuildRange         qbrTransDate =
qbdsVendTrans.addRange(fieldNum(VendTrans, TransDate));
    QueryRun                queryRun;
    TransDate               dateYear = SystemDateGet();
    VendTrans               vendTrans;
    ;
    qbrTransDate.value(queryRange(dateStartYr(dateYear),
dateEndYr(dateYear)));
    queryRun = new QueryRun(query);
    info(queryRun.query().dataSourceNo(1).toString());
    while (queryRun.next())
    {
        vendTrans = queryRun.get(tableNum(VendTrans));
        infolog.messageWin().addLine(strFmt("%1", vendTrans.TransDate));
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: