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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Convert the year 1900 to the year 2000
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ask SQLTeam Question

0 Posts

Posted - 06/22/2006 :  09:45:27  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Minnie writes "How do you convert the year 1900 to 2000
and 1901 to 2001..etc"

In (Som, Ni, Yak)

17689 Posts

Posted - 06/22/2006 :  09:59:38  Show Profile  Reply with Quote
if it is a datetime data type

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


Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 06/22/2006 :  10:01:01  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Declare @d datetime
set @d='1900-01-01 10:10:10'
Select @d as [date], DateAdd(year,100,@d) as [date+100years]


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000