-
datetime to smalldatetime
I tried to change field type from datetime to smalldatetime, because I
only store date part of date time.
I got error "The conversion from datetime data type to smalldatetime
data type resulted in a smalldatetime overflow error." from SQL
Server.
I just wonder that can I convert from datetime to smalldatetime even
my data are date part only or precision is minuntes.
Thanks again for any information,
-
Re: datetime to smalldatetime
iccsi (inunghatgmaildotcom) writes:
> I tried to change field type from datetime to smalldatetime, because I
> only store date part of date time.
That's is not going to help. There is no pure date type in SQL 2000 - it
was added in SQL 2008.
> I got error "The conversion from datetime data type to smalldatetime
> data type resulted in a smalldatetime overflow error." from SQL
> Server.
>
> I just wonder that can I convert from datetime to smalldatetime even
> my data are date part only or precision is minuntes.
Seems like you have data in your column outside the range for
smalldatetime which is from 1900-01-01 to 2079-06-06.
Maybe you have stored "blank" or 0 in your Access database? I would
suspect that ends up as 1899-12-30.
--
Erland Sommarskog, SQL Server MVP, esquelatsommarskogdotse
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx