• KumarSQLDBA (9/14/2012)


    Hi Guys,

    Please help me to get YYYYMM from Getdate()?

    I have tried the below query.But it gives 20129 only not 201209 format?

    ANy help will be appreciated!!!!!!!!!

    SELECT cast(year(getdate()) as char(4)) + right('0' + cast(month(getdate()) as varchar), 2);