static void DateRangeTest(Args _args)
{
DateRangeTest drt;
{
DateRangeTest drt;
Query query=new Query();
QueryRun qrun;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
date d=today();
qbds=query.addDataSource(tableNum(DateRangeTest));
QueryRun qrun;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
date d=today();
qbds=query.addDataSource(tableNum(DateRangeTest));
qbr=qbds.addRange(fieldNum(DateRangeTest,dataAreaId));
//Method 1
//qbr.value(strfmt(‘(%1<=%2)&& (%3>=%4)’,fieldstr(DateRangeTest,FromDate),Date2StrXpp(d),fieldstr(DateRangeTest,ToDate),Date2StrXpp(d)));
//Method 2
qbr.value(strfmt(‘(FromDate<=%1)&& (ToDate>=%2)’,Date2StrXpp(d),Date2StrXpp(d)));
//Method 1
//qbr.value(strfmt(‘(%1<=%2)&& (%3>=%4)’,fieldstr(DateRangeTest,FromDate),Date2StrXpp(d),fieldstr(DateRangeTest,ToDate),Date2StrXpp(d)));
//Method 2
qbr.value(strfmt(‘(FromDate<=%1)&& (ToDate>=%2)’,Date2StrXpp(d),Date2StrXpp(d)));
qrun=new QueryRun(query);
info(qrun.query().dataSourceNo(1).toString());
while(qrun.next())
{
drt=qrun.get(tableNum(DateRangeTest));
info(drt.Name);
}
info(drt.getSQLStatement());
}
info(qrun.query().dataSourceNo(1).toString());
while(qrun.next())
{
drt=qrun.get(tableNum(DateRangeTest));
info(drt.Name);
}
info(drt.getSQLStatement());
}
Komentar
Posting Komentar