Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Convert the year 1900 to the year 2000

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-06-22 : 09:45:27
Minnie writes "How do you convert the year 1900 to 2000
and 1901 to 2001..etc"

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-22 : 09:59:38
if it is a datetime data type

update table
set datecol = dateadd(year, 100, datecol)



KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-22 : 10:01:01
Declare @d datetime
set @d='1900-01-01 10:10:10'
Select @d as [date], DateAdd(year,100,@d) as [date+100years]

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -