Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/12/2022 01:00 PM
Hi!
I am trying to create report that shows when user record has been updated in Saviynt.
I am using following query, but it only shows 4 user records and none of them is updated
from ongoing date - 30 days when i check Update History?
Am i missing something?
select b.USERKEY from usershistory a,users b where DATEDIFF(a.UPDATEDATE, now()) < 30
AND a.USERKEY = b.USERKEY
AND b.STATUSKEY =1
AND b.EMPLOYEEID IS NOT NULL
AND b.SYSTEMUSERNAME IS NOT NULL;
Best Regards, Päivi
Solved! Go to Solution.
04/12/2022 02:08 PM
Hi Päivi,
You need to use DATEDIFF(now(),a.UPDATEDATE) and not DATEDIFF(a.UPDATEDATE,now()).
Sample query -
select b.USERKEY, b.username, a.UPDATEDATE
from usershistory a,users b where DATEDIFF(now(),a.UPDATEDATE) < 30
AND a.USERKEY = b.USERKEY
AND b.STATUSKEY =1
AND b.EMPLOYEEID IS NOT NULL
AND b.SYSTEMUSERNAME IS NOT NULL order by userkey;
Regards,
Saparja
04/12/2022 02:08 PM
Hi!
This is restricted from use: a.UPDATEDATE,
best Regards, Päivi
04/12/2022 02:08 PM
Hi,
Please change the alias and try
select b.USERKEY, b.username, a.UPDATEDATE as 'User Update Date'
from usershistory a,users b where DATEDIFF(now(),a.UPDATEDATE) < 30
AND a.USERKEY = b.USERKEY
AND b.STATUSKEY =1
AND b.EMPLOYEEID IS NOT NULL
AND b.SYSTEMUSERNAME IS NOT NULL order by userkey;
Regards,
Saparja