Given a datepart and a column of date or timestamp data type, we can increment date or timestamp values by a specified interval.
For example, in SQLite, the statement
DATETIME(time1, '+3 hours', '40 minutes', '2 days');
Would return a time 3 hours, 20 minutes, and 2 days after
Imagine that each dessert in our
baked_goods table is inspected 2 hours, 30 minutes, and 1 day after the manufacture time. To derive the inspection date for each baked good, we can use the following query
SELECT DATETIME(manufacture_time, '+2 hours', '30 minutes', '1 day') as inspection_time