ProdRouteTrans prodRouteTrans; Query q; QueryBuildDataSource qDS; QueryBuildRange qRange; QueryRun qRun; ... while select * from vm_resources where vm_resources.resource_mask != "" && vm_resources.active == NoYes::Yes { q = new Query(); qDS = q.addDataSource( TableNum( ProdRouteTrans ) ); /* date range since..till */ qRange = qDS.addRange( FieldNum( ProdRouteTrans, DateWIP ) ); qRange.value( SysQuery::range( startDate, endDate ) ); qRun = new QueryRun( q ); while ( qRun.next() ) { /* get ProdRouteTrans data from query */ prodRouteTrans = qRun.get( TableNum( ProdRouteTrans ) ); ... } ... }
Microsoft AX 2012, X++, C#, SQL server, SSRS, Java, JavaFX, Oracle, PL/SQL, Delphi - codes examples, step-by-step tutorials, experiences.
Thursday, February 8, 2018
AX - How use Query with date range (since-till) in where condition
When you need use date range in Query where condition, use SysQuery::range() function:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment