I'm sure there is an easier way to do this but it it what i came up with:
SELECT replicate('0', 2-LEN(DATEPART(HH,'1/1/11 9:00am'))) + CONVERT(varchar(2),DATEPART(HH,'1/1/11 9:00am')) AS 'SubmissionID'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.