SQL Leading zeros

The problem

DECLARE @StartDateTime SMALLDATETIMESET @StartDateTime = '2011-06-20 1:00:00'SELECT CONVERT(CHAR(2), DATEPART(minute, @StartDateTime)) AS Minutes

Leave a Reply

Your email address will not be published. Required fields are marked *