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
 General SQL Server Forums
 New to SQL Server Programming
 Issue with dates in SQL Server ( Century 19/20)

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-12-24 : 12:35:09
Hello every one,

I would like to know, how SQL Server treats the century part of the date, Say suppose a table has date as 31-Dec-45 ( col data type as varchar).

How does it treats weather 1945 or 2045, I would like to know how the system assumes century part if not present as value.

Regards,
aak.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-12-24 : 13:01:32
Default is:
00-49: century = 2000
50-99: century = 1900

But this can be changed with sp_configure. See this article: http://www.blackwasp.co.uk/SQLDateTimeCutOff.aspx
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-12-24 : 13:43:41
Thanks Russell, got it. just in case if you have an Idea, is it same for Oracle 10g as well...

Thanks again for your prompt reply...

Merry Chirstmas
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-12-28 : 09:52:21
same. see here: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements004.htm#SQLRF00210
Go to Top of Page
   

- Advertisement -