Цитата:
Posted on 21-Mar-2006 at microsoft.public.axapta.programming by link
i want to make a query in the form ProdTable to show all the records that the
SchedEndDate > Delievry date.
how can i do?
You can specify not just simple range values but query conditions involving two or more fields using QueryBuildRange::value() method. Axapta kernel will parse these conditions into SQL statement automatically. For example, in your case:
X++:
Query query;
// ...
query = new Query();
query.addDataSource(tableNum(ProdTable))
.addRange(fieldNum(ProdTable, SchedEnd))
.value(strfmt("(%1 > %2)",
fieldStr(ProdTable, SchedEnd),
fieldStr(ProdTable, DlvDate)));
info(query.dataSourceNo(1).toString()); // prints the resulting sql statement