DateAdd
Adds offset intervals to a date/time value and returns the new date/time. Use a negative offset to subtract. Interval names are not case-sensitive.
String DateAdd(String dateTime, String interval, Numeric offset)
| Interval | Aliases |
| Year | yy, yyyy |
| Quarter | qq, q |
| Month | mm, m |
| Week | ww, wk |
| Weekday | dw (Monday to Friday) |
| Day | dy |
| DayOfYear | |
| Hour | hh |
| Minute | mi |
| Second | s |
| Millisecond | ms |
Result format
The result uses the server's default date/time format, which depends on its culture settings. Wrap DateAdd in FormatDateTime for a predictable format.SELECT FormatDateTime(DateAdd('2024-01-31', 'Month', 1), 'yyyy-MM-dd') as Result FROM SingleSELECT FormatDateTime(DateAdd(DateTimeUTC(), 'Day', -10), 'yyyy/MM/dd hh:mm:ss tt') as Result FROM SingleSQL :: IsEmpty
Returns true (1) if the given value is null or an empty string.
SQL :: IsEqual
Returns true (1) if the two given values are equal. The comparison is case-sensitive.
SQL :: IsGreater
Returns true (1) if the first value is greater than the second.
SQL :: IsGreaterOrEqual
Returns true (1) if the first value is greater than or equal to the second.
SQL :: IsInteger
Returns true (1) if the given value is a whole number, with an optional leading sign.
SQL :: IsLess
Returns true (1) if the first value is less than the second.
SQL :: IsLessOrEqual
Returns true (1) if the first value is less than or equal to the second.
SQL :: IsLike
Returns true (1) if the text matches the pattern. The pattern uses the same wildcards as Like: % matches any number of characters and _ matches a single character.
SQL :: IsNotBetween
Returns true (1) if the value is outside of the given range. The range boundaries are considered inside the range.
SQL :: IsNotEqual
Returns true (1) if the two given values are not equal. The comparison is case-sensitive.