views:

48

answers:

1

Hello,

how can i count the number of days between (sysdate) & a column called hiredate in PL/SQL.

Thanks.

+6  A: 

You could try the following:

SELECT TRUNC(sysdate) - TRUNC(t.hiredate) FROM myTable t; 

This will result in a count of days represented in decimal. The TRUNC of the timestamps will ensure that you will get a consistent result on successive calls.

akf
thx, it was the correct answer
LJme
@LJme - if this response solves your problem you should accept it. See this FAQ answer: http://meta.stackoverflow.com/questions/5234/how-does-accepting-an-answer-work/5235#5235
APC