8. Date Arithmetic
Adding and Subtracting Days, Months, and Years
-- Oracle
select
hiredate-5 as hd_minus_5D,
hiredate+5 as hd_plus_5D,
add_months(hiredate,-5) as hd_minus_5M,
add_months(hiredate,5) as hd_plus_5M,
add_months(hiredate,-5*12) as hd_minus_5Y,
add_months(hiredate,5*12) as hd_plus_5Y
from emp
where deptno = 10
Determining the Number of Days Between Two Dates
Determining the Number of Business Days Between Two Dates
Determining the Number of Months or Years Between Two Dates
Determining the Number of Seconds, Minutes, or Hours Between Two Dates
Counting the Occurrences of Weekdays in a Year

Determining the Date Difference Between the Current Record and the Next Record
Last updated
