• Lon-860191 (11/8/2012)


    Good question, but I would question if a method is reliable if it does not work less than 1/3 of the time daily, method 2 overloaded at 8 am since this means that it would be only good during after midnight but only through early morning.

    Can you prove this by posting an example of T-SQL code?

    It seems to me that the method works fine even for the last 100 nanoseconds of the day:

    declare @t datetime2;

    set @t = '2012-11-08T23:59:59.9999999';

    select @t, cast(cast(reverse(substring(cast(@t as binary(9)),2,5)) as binary(5)) as bigint)*100;

    ---------------------- --------------------

    2012-11-08 23:59:59.99 86399999999900

    (1 row(s) affected)