Samx
Ten Centuries
Points: 1021
More actions
November 20, 2006 at 6:41 am
#121575
Hello,
How can I have the minutes with 2 digit every time ?
Regards.
1> select datename(minute, getdate())
2> go
------------------------------
5
Expected :
05
Ram Ram
Points: 1079
November 20, 2006 at 6:59 am
#672917
Hi
Try this out
SELECT RIGHT('0'+DATENAME(MINUTE,GETDATE()),2)
Ram
Ninja's_RGR'us
SSC Guru
Points: 294069
November 20, 2006 at 7:05 am
#672919
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
#672922
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