I am trying to create a snapshot of a vendor and put the results in a grid. I am having trouble with the part of figuring out if a record is less than two years old. I created the query first in T-SQL and tried to translate to x++ select syntax, but am having trouble finding anything that represents the SQL well in this small instance.
Here is the SQL I used in the where clause:
WHERE InvoiceDate > (DATEADD(Year, -2, GETDATE())
Is there anything like this in x++ where i can put it in the where clause? Thanks in advance for any help you can provide.
You cannot use functions within the group by. You can create a View of the InventTrans table and add two compued columns to split the Date, one column for Month and other for Year and then do your Query based on the View.