Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Error : Query has been terminated due to longer execution time

pragyapurwar03
New Contributor
New Contributor

Hi I am trying to create a new report with this query 

select u.username as USERNAME, u.firstname, u.lastname, a.name as 'Account Name',r.role_name as 'Role Name', r.description as 'Description', rua.enddate as 'Role End Date'
from users u, roles r, role_user_account rua, accounts a, account_entitlements1 ae1
where u.USERKEY=rua.USERKEY
and r.ROLEKEY=rua.ROLEKEY
and a.ACCOUNTKEY=rua.ACCOUNTKEY
and rua.ENDDATE is not null
and r.STATUS=1
and u.STATUSKEY=1
and a.STATUS in ('1','Active','Manually Provisioned')
and DATEDIFF(ae1.ENDDATE,sysdate()) between 0 AND (select configdata from configuration where name = 'NUMBEROFDAYSBEFOREROLEEXPIRYDATE') order by username

it is giving 'Error : Query has been terminated due to longer execution time' in data analyzer and not giving any result in preview as well 

[This post has been edited by a Moderator to move to its own thread.]

1 REPLY 1

rushikeshvartak
All-Star
All-Star

SELECT u.username    AS USERNAME,
       u.firstname,
       u.lastname,
       a.NAME        AS 'Account Name',
       r.role_name   AS 'Role Name',
       r.description AS 'Description',
       rua.enddate   AS 'Role End Date'
FROM   users u
       JOIN role_user_account rua
         ON u.userkey = rua.userkey
       JOIN roles r
         ON r.rolekey = rua.rolekey
       JOIN accounts a
         ON a.accountkey = rua.accountkey
       JOIN account_entitlements1 ae1
         ON ae1.accountkey = rua.accountkey
WHERE  rua.enddate IS NOT NULL
       AND r.status = 1
       AND u.statuskey = 1
       AND a.status IN ( '1', 'Active', 'Manually Provisioned' )
       AND Datediff(ae1.enddate, Sysdate()) BETWEEN 0 AND
               (SELECT configdata
                                                           FROM   configuration
                                                           WHERE  NAME =
               'NUMBEROFDAYSBEFOREROLEEXPIRYDATE'
               )
ORDER  BY u.username; 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.