• I'm guessing the @EndDT for the first code example should have been.

    @EndDT = '2000-01-02 12:34:56.789'

    That gives the same answer as the example.