on 03-07-2018 7:37 PM
Hi there, I'm trying to build a query that identifies changes on item group this year.
I've got the data from table AITM and so far the query looks like below. The issue that I'm having is that the UpdateDate is picking up the whole table changes (and not only the item group code changes). Like I said as a result I want to see all the items that had the item group changed in the current year. Does anyone have any idea on how to get it?
Thank you!
SELECT DISTINCT
T0."Code", T0."Name", T0."GroupCode", T1."GroupCode" , T0."UpdateDate"
FROM (select "Code", "Name", "GroupCode", "UpdateDate" FROM AITM) T0
INNER JOIN (select "Code", "Name", "GroupCode", "UpdateDate" FROM AITM) T1 ON T0."Code" = T1."Code"
WHERE T0."GroupCode" <> T1."GroupCode" AND
DAYS_BETWEEN( T0."UpdateDate", CURRENT_DATE) <= 80
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.