We use the Dynamics AX standard queries to create queries for e.g. PriceDiscTable. Assume we want to have all PriceDiscTables for ItemNumber "xy" it's quite easy:
ItemRelation = xy
Additional we would like to retrieve only records that have a ValidTo date greater than yesterday.
ToDate: >day(-1)
So i would expect that a record with ToDate 2017/07/03 is part of this query. But it isn't. It doesn't matter which value i try, it will always display only those records with ToDate greater than today, that corresponds to ">day()".
You can simply reconstruct this behaviour in the TableBrowser for table PriceDiscTable.
If i use this expression in a simple job, it gives the expected output with date from yesterday:
info(strfmt(">%1",SysQueryRangeUtil::day(-1)));
Btw:
The function SysQueryRangeUtil::GreaterThanDate(-1) works like expected, but according to the documentation day(-1) should work as well.
Any ideas for this strange behaviour or do i miss something?