Home Forums SQL Server 7,2000 General Getdate and Datepart RE: Getdate and Datepart
Krishnan Kaniappan
Ten Centuries
Points: 1051
More actions
February 21, 2006 at 2:26 pm
#622457
declare @year char(4),@month char(2)
set @year=convert(char(4),getdate(),120)
set @month=right(convert(char(7),getdate(),120),2)
select @month + '-' + @year
-Krishnan