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
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question