Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

sql query for accounts who are inactive from 90 days

asharma
Regular Contributor II
Regular Contributor II

Hi Team,

I am trying to create a analytics for those accounts who are inactive from 90 days using sql query however unable to create sql query for the same.

Kindly help with SQL query for accounts who are inactive from last 90 days so that we can delete those accounts.

Thanks

2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Select name , endpointkey from accounts where lastlogondate  > (DATE_SUB(NOW(), INTERVAL 90 DAY))


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

asharma
Regular Contributor II
Regular Contributor II

I am preparing the analytics to delete the user who are inactive from 90 days from AD and for that it requires SQL query which will fetch the data from below tables using join. 

accounts
users
useraccount
endpoints

can you help me with this query. as results from above query are not satisfactory.