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

Analytics timing out with my query, any insight?

theosveg
Regular Contributor II
Regular Contributor II

SELECT u.owner as ManagerEmail, CONCAT(u.Firstname, ' ', u.Lastname) AS DISPLAYNAME, u.email AS ConsultantEmail, u.EMPLOYEEID AS EmployeeNumber, u.CUSTOMPROPERTY12 AS EmployeeStatus, CASE WHEN u.STATUSKEY = 1 THEN 'Active' ELSE 'Inactive' END AS StatusSaviynt, u.ENDDATE AS ConsultantEndDate, DATEDIFF(u.ENDDATE, CURDATE()) AS DaysUntilEndDate FROM users u WHERE u.employeetype = 'Contractor' AND DATEDIFF(u.ENDDATE, CURDATE()) = 14 AND u.STATUSKEY = 1;

theosveg_0-1726703868656.png

 

 

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

SELECT u.owner                              AS Manager_Email,
       Concat(u.firstname, ' ', u.lastname) AS Full_Name,
       u.email                              AS Consultant_Email,
       u.employeeid                         AS Employee_Number,
       u.customproperty12                   AS Employee_Status,
       CASE
         WHEN u.statuskey = 1 THEN 'Active'
         ELSE 'Inactive'
       END                                  AS Employment_Status,
       u.enddate                            AS Consultant_End_Date,
       Datediff(u.enddate, Curdate())       AS Days_Until_End_Date
FROM   users u
WHERE  u.employeetype = 'Contractor'
       AND Datediff(u.enddate, Curdate()) = 14
       AND u.statuskey = 1; 


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

theosveg
Regular Contributor II
Regular Contributor II

I am getting the same error, what exactly is the issue with the format of the query?

  • Add limit 1 and validate
  • Does it works with preview mode ?
  • Does it work from Data analyzer ?
SELECT u.owner                              AS Manager_Email,
       CONCAT(u.firstname, ' ', u.lastname) AS Full_Name,
       u.email                              AS Consultant_Email,
       u.employeeid                         AS Employee_Number,
       u.customproperty12                   AS Employee_Status,
       CASE
         WHEN u.statuskey = 1 THEN 'Active'
         ELSE 'Inactive'
       END                                  AS Employment_Status,
       u.enddate                            AS Consultant_End_Date,
       DATEDIFF(u.enddate, CURDATE())       AS Days_Until_End_Date
FROM   users u
WHERE  u.employeetype = 'Contractor'
       AND u.enddate = CURDATE() + INTERVAL 14 DAY
       AND u.statuskey = 1;

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

stalluri
Valued Contributor II
Valued Contributor II

@theosveg 

SELECT 
    u.owner AS ManagerEmail, 
    CONCAT(u.Firstname, ' ', u.Lastname) AS DisplayName, 
    u.email AS ConsultantEmail, 
    u.EMPLOYEEID AS EmployeeNumber, 
    u.CUSTOMPROPERTY12 AS EmployeeStatus, 
    CASE WHEN u.STATUSKEY = 1 THEN 'Active' ELSE 'Inactive' END AS StatusSaviynt, 
    u.ENDDATE AS ConsultantEndDate, 
    DATEDIFF(u.ENDDATE, CURDATE()) AS DaysUntilEndDate
FROM 
    users u
WHERE 
    u.employeetype = 'Contractor' 
    AND u.ENDDATE = CURDATE() + INTERVAL 14 DAY
    AND u.STATUSKEY = 1;

Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.