[thelist] New annoying feature of SQL Server

rudy r937 at interlog.com
Fri Jan 3 10:54:01 CST 2003


> Could you help me understand why the 1/1/1900 mystery entry?
> And how to prevent it?

despite any name you give a datetime column such as TimeAccessed, it always
contains both a date portion and a time portion, so that when you assign a
time value to it, without a corresponding date value, it gets the default
jan 1 1900, just like when you assign a date value without a time value, it
gets the default midnight

you cannot prevent this behaviour, but you can take steps to display only
the date or time portion

see CAST and CONVERT
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_
ca-co_2f3o.asp


rudy




More information about the thelist mailing list