0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SQL Serverで日付を加算

Posted at

備忘録

update
	data
set
	Time = (
		SELECT
			FORMAT( DATEADD(month, 6, t2.Time), 'yyyy/MM/dd HH:mm:ss.fff')
		FROM
			data t2
		WHERE
			t2.Time = data.Time
	),
	TimeStr = (
		SELECT
			FORMAT( DATEADD(month, 6,CONVERT(datetime , stuff(stuff(stuff(stuff(data.TimeStr, 9, 0, ' '), 12, 0, ':'), 15, 0, ':'), 18, 0, '.'))), 'yyyyMMddHHmmssfff')
		FROM
			data t2
		WHERE
			t2.Time = data.Time
	)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?