Returns a new datetime based on adding to the date passed to the function.
The following are valid datepart parameters:
Datepart | Abbreviations |
---|---|
year | yy, yyyy |
quarter | qq, q |
month | mm, m |
dayofyear | dy, y |
day | dd, d |
week | wk, ww |
weekday | dw, w |
hour | hh |
minute | mi, n |
second | ss, s |
millisecond | ms |
SQL Server Difference
SQL Server will actually accept the parameters out of order when they are passed from other functions. VistaDB does not support this behavior of SQL Server.
You also cannot pass 0 as a value for a DATETIME. .Net does not cast a 0 to the minimum date range available.
Both of these will return: 9/30/2007 12:00:00 AM (The end of September).
Output: 1/1/2001 12:00:00 AM
Output: 1/1/2001 12:00:00 AM
Output: 7/15/2007 12:00:00 AM