INTERVAL (Date)
Adds a specified number of days, weeks, months, quarters, or years to a date
Description
The INTERVAL
function allows you to perform date arithmetic by adding or subtracting a specified number of days, months, or years to a given date. This is useful for calculating future dates, project timelines, or aging calculations.
Syntax
datetime
+ INTERVAL number
DAY/MONTH/YEAR
date
: The starting date to which you want to add or subtract an interval.number
: The numeric value representing the amount you want to add or subtract.DAY/MONTH/YEAR: Specify the time unit (day, month, or year) for the interval.
Example
Table
Project
Start Date
Project A
2023-09-10
Project B
2023-08-25
Project C
2023-09-01
Function
`Start Date` + INTERVAL 7 DAY
Results
INTERVAL (date)
2023-09-17
2023-09-01
2023-09-08
Last updated