November 20, 2006 at 6:41 am
Hello,
How can I have the minutes with 2 digit every time ?
Regards.
1> select datename(minute, getdate())
2> go
------------------------------
5
Expected :
------------------------------
05
November 20, 2006 at 6:59 am
Hi
Try this out
SELECT RIGHT('0'+DATENAME(MINUTE,GETDATE()),2)
Ram
November 20, 2006 at 7:05 am
Why do you need to do this?? Formatting is usually better off done client side!
SELECT RIGHT('0' + CONVERT(VARCHAR(2), DATEPART(n, GETDATE())), 2) AS StrMin
November 20, 2006 at 7:20 am
Thank you Sriram !
It's allright !
Regards
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply