Link to home
Start Free TrialLog in
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?
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of briancostea
briancostea

ASKER

YIKES that was fast.  That solved the problem but unfortunately the Telerik control I am using still doesn't convert it properly.  Awarding points.
Thanks!