0

I'm trying to calculate number of days in between to DATES stored in my database, but I was not able to get any data using DATEDIFF or Extract.

Brief Example:

TABLE (PROJECT) PROJECT START, PROJECT END

What I'm looking to get is the amount of days each project lasted.

Any hint will help!

1 Answers1

0

When you subtract one date from another in Oracle, you get a decimal value. The numbers to the left of the decimal point are the days, the numbers to the right is the decimal fraction.

  select sysdate - date '2022-01-03' as delta from dual;

The resulting value on the day I am running this is 37.65. Since you asked for days, I'll leave it to you to truncate this to 37 days or round it to 38.

Brian Leach
  • 2,025
  • 1
  • 11
  • 14