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), '/', '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With