Quick
Ref.
Functions
- date
- number
- string
Data Types
- date
- number
- string
| Date CalculationsDifferent implementations of SQL have different functions for calculation on dates
d is 20th May 1962
| Question | Answer | Access |
MySQL |
| Which year? | 1962 | year(d) |
year(d) |
| Which month? | 5 | month(d) |
month(d) |
| Which day? | 20 | day(d) |
day(d) |
| Day of the week? | 7 (Sunday) | weekday(d) |
dayofweek(d) |
| The day after | 21 May 1962 | d+1 |
date_add(d, interval 1 day) |
| Todays date/time? |
| Now() |
now() |
| |