How to get users who do not access jira from a certain date?I jira in mysql.

how to get users who do not access jira from a certain date?I jira in mysql.

before bd oracle to this query:

select a.user_name, a.updated_date, a.fecha , email_address
from
(select u.user_name, u.updated_date, nvl2(l.attribute_value,to_date ('01/01/1970', 'dd/mm/yyyy')+(l.attribute_value/1000/60/60/24) ,null) fecha, email_address
from jira.cwd_user u, jira.cwd_user_attributes l
where u.id = l.user_id (+)
and l.attribute_name (+) = 'login.lastLoginMillis'
and u.active = 1) a
where (a.fecha is null or a.fecha < '31/12/2015')
and a.updated_date <'31/12/2015

2 answers

This widget could not be displayed.

Try the following query

SELECT u.user_name, u.email_address
FROM cwd_user u
LEFT JOIN cwd_user_attributes l ON l.user_id = u.id AND l.attribute_name = 'login.lastLoginMillis'
WHERE u.active = 1 AND (
	l.id IS NULL OR (
		TIMESTAMPDIFF(MICROSECOND, now(), '31/12/2015') &gt; (l.attribute_value) * 1000
		OR 
		TIMESTAMPDIFF(SECOND, u.updated_date, '31/12/2015') &lt; 0
	)
)
This widget could not be displayed.

Thank you for your help, it works perfect!!!!

Please accept the answer then, so that it is easier for others who may run into this problem later

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

50 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you