create account

DATEADD to change datetimes in SQL Server by lauweded

View this thread on: hive.blogpeakd.comecency.com
· @lauweded ·
$0.98
DATEADD to change datetimes in SQL Server
## 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)
👍  , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorlauweded
permlinkdateadd-to-change-datetimes-in
categoryhive-169321
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"}"
created2021-04-25 13:58:27
last_update2021-04-25 13:58:27
depth0
children1
last_payout2021-05-02 13:58:27
cashout_time1969-12-31 23:59:59
total_payout_value0.491 HBD
curator_payout_value0.486 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length957
author_reputation1,047,785,333,462
root_title"DATEADD to change datetimes in SQL Server"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id103,283,367
net_rshares1,426,849,462,424
author_curate_reward""
vote details (21)
@hivebuzz ·
Congratulations @lauweded! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@lauweded/payout.png?202105051552"></td><td>You received more than 50 HP as payout for your posts and comments.<br>Your next payout target is 100 HP.<br><sub>The unit is Hive Power equivalent because your rewards can be split into HP and HBD</sub></td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@lauweded) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/hivebuzz/@hivebuzz/false-positive"><img src="https://images.hive.blog/64x128/https://i.imgur.com/0jzfGcE.png"></a></td><td><a href="/hivebuzz/@hivebuzz/false-positive">False-Positive phishing alert reported by antivirus software</a></td></tr><tr><td><a href="/hivebuzz/@hivebuzz/pud-202105-feedback"><img src="https://images.hive.blog/64x128/https://i.imgur.com/zHjYI1k.jpg"></a></td><td><a href="/hivebuzz/@hivebuzz/pud-202105-feedback">Feedback from the May 1st Hive Power Up Day</a></td></tr></table>

###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22109%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/147)!
properties (22)
authorhivebuzz
permlinkhivebuzz-notify-lauweded-20210506t002644000z
categoryhive-169321
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2021-05-06 00:26:42
last_update2021-05-06 00:26:42
depth1
children0
last_payout2021-05-13 00:26:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,517
author_reputation369,385,216,814,911
root_title"DATEADD to change datetimes in SQL Server"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id103,515,482
net_rshares0