I need the date as ddmmyyyy
without any spacers.
How can I do this?
I can get yyyymmdd
using CONVERT(VARCHAR, [MyDateTime], 112)
But I need the reverse of this.
SQL Server 2008
CONVERT
style 103 is dd/mm/yyyy. Then use the REPLACE
function to eliminate the slashes.
SELECT REPLACE(CONVERT(CHAR(10), [MyDateTime], 103), '/', '')