Dans ce cas on veut extraire le mois a deux charactères du mois passé !

RIGHT('00' + CONVERT(NVARCHAR(2), DATEPART(MONTH, dateadd(m,-1,GETDATE()))), 2)

Merci à Louis de m’avoir sauver avec celle là !

Tagged with:  

ALTER DATABASE YourDatabase DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

Tagged with:  
SELECT table_schema , sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
 FROM information_schema.TABLES GROUP BY table_schema ;
Tagged with:  

select * from TABLE where DATETIME_FIELD between CAST(GETDATE() AS DATE) AND DATEADD(DAY, 1, CAST(GETDATE() AS DATE))

Tagged with: