SELECT
usr.user_name,
rsp.responsibility_name,
MAX(ful.start_time) AS LAST_CONNECT
FROM
apps.icx_sessions ses
JOIN apps.fnd_user usr ON ses.user_id = usr.user_id
JOIN apps.fnd_logins ful ON ses.login_id = ful.login_id
JOIN apps.fnd_responsibility_tl rsp ON ses.responsibility_id = rsp.responsibility_id
WHERE
usr.end_date IS NULL -- Only current active users
AND rsp.responsibility_name IS NOT NULL
GROUP BY
usr.user_name, rsp.responsibility_name
HAVING
MAX(ful.start_time) < (SYSDATE - 400) -- 400 days threshold
OR MAX(ful.start_time) IS NULL -- Never accessed
ORDER BY
usr.user_name, rsp.responsibility_name;