operations | 0. | 0. | comment |
---|
1. | parent_author | "" |
---|
parent_permlink | hive-169321 |
---|
author | lauweded |
---|
permlink | dateadd-to-change-datetimes-in |
---|
title | "DATEADD to change datetimes in SQL Server" |
---|
body | "## Basic syntax
```SQL
DATEADD(<Unit of time>, <Units>, <Date>)
-- Add 5 days to 04/23/2021
DATEADD(DAY, 5, '2021-04-23')
-- Substract 5 days to 04/23/2021
DATEADD(MONTH, -5, '2021-04-23')
```
## Units of time
| Unit of time | Abbreviation |
| ------------ | ------------ |
| NANOSECOND | ns |
| MICROSECOND | mcs |
| MILLISECOND | ms |
| SECOND | ss, s |
| MINUTE | mi, n |
| HOUR | hh |
| WEEKDAY | dw, w |
| WEEK | wk, ww |
| DAY | dd, d |
| DAYOFYEAR | dy, d |
| MONTH | mm, m |
| QUARTER | qq, q |
| YEAR | yy, yyyy |
## More information
To get more info on the [Docs](https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?redirectedfrom=MSDN&view=sql-server-ver15)" |
---|
json_metadata | "{"links": ["https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?redirectedfrom=MSDN&view=sql-server-ver15"], "tags": ["hive-169321", "sql", "sql-server", "datetime", "dev", "dev-girl", "programming", "db"], "app": "ecency/3.0.16-vision", "format": "markdown+html"}" |
---|
|
---|
|
---|
1. | 0. | comment_options |
---|
1. | author | lauweded |
---|
permlink | dateadd-to-change-datetimes-in |
---|
max_accepted_payout | 1,000,000.000 HBD |
---|
percent_hbd | 10,000 |
---|
allow_votes | true |
---|
allow_curation_rewards | true |
---|
extensions | [] |
---|
|
---|
|
---|
2. | 0. | custom_json |
---|
1. | required_auths | [] |
---|
required_posting_auths | |
---|
id | follow |
---|
json | "["reblog", {"account": "lauweded", "author": "lauweded", "permlink": "dateadd-to-change-datetimes-in"}]" |
---|
|
---|
|
---|
|
---|