• What do you want to do for midnight? Do you want a single 0 for the hour? If you want a 0 for midnight then this would work:

    SELECT

    CASE

    WHEN DATEPART(Hour, CURRENT_TIMESTAMP) > 12 THEN DATEPART(hour, CURRENT_TIMESTAMP) - 12

    ELSE DATEPART(Hour, CURRENT_TIMESTAMP)

    END AS the_time