Steven Danowitz
Grasshopper
Points: 16
More actions
March 11, 2009 at 2:55 pm
#957913
select convert(varchar(2), getdate(), 1)
J-440512
SSCertifiable
Points: 6285
March 12, 2009 at 3:41 pm
#958797
Michael Valentine Jones (3/11/2009)Shorter.select [Month] = right(100+month(getdate()),2)Results:Month-----03
Michael Valentine Jones (3/11/2009)
select [Month] = right(100+month(getdate()),2)
Results:
Month
-----
03
I like that one! The use of of 100 is clever.
I used something like RIGHT('00' + CONVERT(varchar(2), month(getdate()), 2)
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply