• While you're investigating JLS' questions, this is worth playing with:

    SELECT

    [DTstart date],

    [DTend date],

    SecondsDifference = DATEDIFF(second,[DTend date],[DTstart date]),

    SecondsDifference = ABS(DATEDIFF(second,[DTstart date],[DTend date]))

    FROM (

    SELECT

    [DTstart date] = CONVERT(DATETIME,STUFF(STUFF(CAST(d.[start date] AS VARCHAR(8)),3,0,':'),6,0,':'),114),

    [DTend date] = CONVERT(DATETIME,STUFF(STUFF(CAST(d.[end date] AS VARCHAR(8)),3,0,':'),6,0,':'),114)

    FROM (

    SELECT [start date] = '235641', [end date] = '001612'

    ) d

    ) e

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden