Avatar of briancostea
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?
Microsoft SQL ServerASP.NET

Avatar of undefined
Last Comment
briancostea

8/22/2022 - Mon