1

Topic: Help to transform date (to nullify time to remove 2000)

Good afternoon.
In the table there is a column with date _Period date there looks as follows 4016-01-01 21:01:32.000
It is necessary that year would decrease on 2000 and time (2016-01-01 00:00:00.000) was nullified.
Help a simple example (SQL to me it is not conducted yet). SQL Serv 2008

2

Re: Help to transform date (to nullify time to remove 2000)

Baters wrote:

In the table there is a column with date _Period date there looks as follows 4016-01-01 21:01:32.000
It is necessary that year would decrease on 2000 and time (2016-01-01 00:00:00.000) was nullified.
Help a simple example (SQL to me it is not conducted yet). SQL Serv 2008

update to [table] set _Period = dateadd (dd,-2000, convert (date, _Period))

3

Re: Help to transform date (to nullify time to remove 2000)

dateadd () + faq

4

Re: Help to transform date (to nullify time to remove 2000)

alexeyvg;
Thanks.

5

Re: Help to transform date (to nullify time to remove 2000)

Baters;
1C?