Показать сообщение отдельно
Старый 22.03.2006, 12:04   #1  
Maxim Gorbunov is offline
Maxim Gorbunov
Administrator
Соотечественники
Лучший по профессии 2009
 
2,483 / 645 (26) +++++++
Регистрация: 27.11.2001
Адрес: Dubai, UAE
query, compare two fields (by link)
Цитата:
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
__________________
Not registered yet? Register here!
Have comments, questions, suggestions or anything else regarding our web site? Don't hesitate, send them to me