I'm trying to leave the period from 201601 to 20161 in SQL, but I can not do it at all!
Can anyone help me?
SELECT CONVERT(NUMERIC(5), CONVERT(VARCHAR(4), YEAR(Periodo_Mensal))+
CONVERT(VARCHAR(4), MONTH(Periodo_Mensal))) AS PERIODO_MENSAL
I tried LEN
, tried REPLACE
, but nothing was right.