Dear interested reader,
how do I format a date (smalldatetime) in Mai 2010 (i.e. 06.05.2010 => Mai 2010 or 06.10.2009 => October 2009)
thx a lot... greetings
Dear interested reader,
how do I format a date (smalldatetime) in Mai 2010 (i.e. 06.05.2010 => Mai 2010 or 06.10.2009 => October 2009)
thx a lot... greetings
SELECT SUBSTRING(CONVERT(VARCHAR(20), GETDATE(), 107), 0, 4) + SUBSTRING(CONVERT(VARCHAR(20), GETDATE(), 107), 8, 5)
Changing GETDATE()
with your column.
You can use the CONVERT function to convert it to a string, the function can take an optional 3d parameter called style that takes an integer determining the formatting.
more info here