Reputation: 157
I was previously using:
Left(replace(cast(TICKET_EXPIRATION_DATE as varchar(10)), ''-'', ''''),9)
But I need to change the format of the date to be DDMMMYYYY. Any suggestions?
Thanks!
Upvotes: 1
Views: 395
Reputation: 86735
Assuming SQL Server, and that your original datatype is one of the DATE datatypes...
REPLACE(CONVERT(VARCHAR(11), TICKET_EXPIRATION_DATE, 106), ' ', '')
http://sqlfiddle.com/#!18/0f5b0/7
Upvotes: 2