all groups > sql server new users > november 2004 >
You're in the

sql server new users

group:

datetime to smalldatetime



datetime to smalldatetime Gerald Baeck
11/30/2004 5:55:21 PM
sql server new users: Is there a way to convert a datetime field to a smalldatetime field. I try
to Update the filed with a cast or convert function it htrows an overflow
exception, also changing the datatype via mmc is not possible.

thx, Gerald.

Re: datetime to smalldatetime Steve Kass
11/30/2004 6:53:02 PM
Gerald,

If you're getting an error updating a smalldatetime column with a
datetime value, you probably have a datetime value that is outside the
range of the type smalldatetime. Can you look for such values this way?

select
datetimecolumn
from sourceOfColumn
where datetimecolumn < '19000101'
or datetimecolumn >= '20790607'

Steve Kass
Drew University

[quoted text, click to view]
Re: datetime to smalldatetime Gerald Baeck
12/1/2004 1:20:28 AM
thx, that was it

"Steve Kass" <skass@drew.edu> schrieb im Newsbeitrag
news:OVWwIfz1EHA.1524@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button