6
How is done in Sqlserver so that the result comes with zero left ?
in mysql would look like this:
select lpad(mes,2,0 ) as 'mes', ano from tab_qualquer;
How does something equivalent in Sql Server?
I’ve searched the https://stackoverflow.com/questions/5912416/lpad-in-sql-server-2008 and I did so:
select distinct
right(replicate('0',2) + mes,2) as mes,
ano
from tabela
and made the following mistake:
Error code 0, state of SQL 22019: Unrecognized SQL escape 'year' at line position 702. Row 1, column 1
This select would not return what you need, but it was also not to give error. Could you show how the structure of your table is? What types of month and year attributes
– Randrade