I need to convert datetime to float values before calculation and aggrigation func sum using and i have noticed strange fraction part it gives. Here is the code:
select
DATEDIFF_BIG(MILLISECOND, cast(N'2021-01-01 00:00:00.000' as datetime), cast(N'2021-01-01 00:00:05.000' as datetime))/1000.0
, convert(float, cast(N'2021-01-01 00:00:05.000' as datetime),0)*100000 - convert(float,cast(N'2021-01-01 00:00:00.000' as datetime),0)*100000
gives the following results:
5.000000 5.78703689575195
So where the fraction part comes from (in the second expression)?