Is there any oracle functions which will return the number of days between two dates like days360 function in excel?
DAYS360 :
“Returns the number of days between two dates based on a 360-day year (twelve 30-day months), which is used in some accounting calculations. Use this function to help compute payments if your accounting system is based on twelve 30-day months.
If the starting date is the last day of a month, it becomes equal to the 30th of the same month. If the ending date is the last day of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1st of the next month; otherwise the ending date becomes equal to the 30th of the same month.”
In Oracle we can do simple arithmetic on dates. Alternatively, we can turn the difference into an INTERVAL datatype:
edit
Okay, the Excel function
days360()calculates the difference between two dates based on a year of twelve thirty-day months. There is no Oracle built-in which does this. Phil Singer has written his own PL/SQL implementation of this: find it here. Also be sure to read his follow-up piece. Certainly Phil’s function does give the results you want: