briancostea
asked on
SQL Server DateTime to Float conversion
I am currently doing the following when in my SQL stored proc to convert a DateTime to a Float.
CAST([my_Date] AS FLOAT) + 2 as ConDate
This works fine except when I have a date such as '2010-11-11 00:00:00.000'. Then the result is returned with no decimal places and when I convert that to a date in a .NET application it is translated as 2010-11-11 12:00:00.000 which isn't correct.
Anyone know if I can force the extra three decimal places?
CAST([my_Date] AS FLOAT) + 2 as ConDate
This works fine except when I have a date such as '2010-11-11 00:00:00.000'. Then the result is returned with no decimal places and when I convert that to a date in a .NET application it is translated as 2010-11-11 12:00:00.000 which isn't correct.
Anyone know if I can force the extra three decimal places?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
ASKER