Date operators
You can modify dates. In the following, hire_date
is DATE '2028-01-30'
.
Operator |
Effect on date |
Example |
Result |
+ |
Add a number of days to a date |
Copy
|
DATE '2028-02-04' |
- |
Find the number of days between two dates |
Copy
|
|
Subtract a number of days from a date |
Copy
|
DATE '2028-01-20' |
Copy
SELECT Date_Sold, Date_Sold + 30 AS agg FROM Sales_Data
SELECT Date_Sold, Date_Sold - 30 AS agg FROM Sales_Data