Problem converting float to datetime -
05-04-2006
, 08:31 AM
Hi
I have problems when converting a float value to a datetime value in the SQL clause on a SQL Server 2005. The date always is two days wrong, e.g. two days past the correct date. The time value is correct.
Converting the same value in MS Excel to a date or using a DataReader in my VB.NET code like:
DateTime.FromOADate(dr("MyFloatField"))
gives the correct date, but converting the float value in the SQL caluse like:
SELECT CONVERT(datetime, MyFloatField, 126)
FROM MyTable
gives a date that is two days past the correct one.
Is this a bug in SQL Server 2005?
-BA- |