Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Updatedate of User

HarishG
Regular Contributor
Regular Contributor

Hi,

There is a requirement that we need to retrieve the userdata which got modified with file upload.

The below query works to get all the users who got updated(even if there is no change in data). But we need only the users whose data(firstname or lastname, etc.) is modified.

select USERNAME, FIRSTNAME, LASTNAME, SAVUPDATEDATE as 'UPDATE DATE' from users where SAVUPDATEDATE>CURDATE()

 

Is there any possibility to retrieve data in this way?

 

Best regards

Harish

1 REPLY 1

DaanishJawed
Saviynt Employee
Saviynt Employee

Hi @HarishG ,

From the latest version onwards, there is a column changelog in usershistory table which you can utilize to check lastname/firstname updates.

Try the below query -

SELECT 
    u.username, u.firstname, u.lastname, uh.changelog
FROM
    users u
        INNER JOIN
    usershistory uh ON u.userkey = uh.userkey
WHERE
    u.SAVUPDATEDATE > CURDATE()
        AND uh.changelog LIKE '%firstname%'
        OR uh.changelog LIKE '%lastname%';