A
A
Artem Kiryanov2019-07-30 13:51:30
SQL
Artem Kiryanov, 2019-07-30 13:51:30

Add month, day, time to date?

There is a table with dates, 100 records, but the dates are indicated in it like this: 1922, and I need to make sure that in addition to the year there is also a month, day and time, i.e. pass the date in the table to this format: 1992-01- 01 00:00:00.
How can this be done? I read about dateadd, but I still don’t really understand how to update.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2019-07-30
@hacker342

SELECT DATEADD( yy, 70, CAST( '1922' AS DATETIME ))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question