Reputation: 11265
For example I have in table row finish
with values:
20-JAN-06;
21-SEP-06;
12-FEB-10;
15-MAR-09;
03-JUL-09;
23-JAN-09;
How can I compare them against sysdate
? I know that this code is not correct:
Select name from project where finish <= sysdate ;
Upvotes: 2
Views: 365
Reputation: 4985
Select name
from project
where to_date(finish, 'DD-MON-YY') <= trunc(sysdate)
Upvotes: 2
Reputation: 107237
Why not use the ANSI standard CURRENT_TIMESTAMP
?
SELECT * FROM SomeTable WHERE Finish <= CURRENT_TIMESTAMP;
Fiddle here
Upvotes: 1
Reputation: 3317
Something like that try cos I don't have oracle to test it
SELECT EMP_NAME, EMPNO
FROM EMP
WHERE TRUNC(START_DATE) = TRUNC(SYSDATE);
or
SELECT emp_name, empno
FROM emp
WHERE start_date >= TRUNC(SYSDATE)
and start_date < TRUNC(SYSDATE)+1
Upvotes: 1