SQLPLUS to pull users logins past 180 days
I have been searching forums, internet etc, and I am at a road block.
I need to pull users from a table based on their last logon time. So I am assuming MAX.
But, here is the tricky part (for me) I want to identify the users that have not login greater than 180 days.
So:
select vt_emphist.empid, max (vt_EMPHIST.LOGON_TIME) from vt_emphist group by vt_emphist.empid
Works, but when I try to do:
WHERE VT_EMPHIST.LOGON_TIME < SYSDATE - 180
It bombs
I am guessing it is probably very simple... And I am looking for zebras...