May 15, 2019 at 2:36 pm
Hi,
I have found things online about this but nothing is working.
I have a field that is a Varchar(20), which holds a Date in it (like this 05/04/2019).
I need it to be in this format --> 05\04\2019.
In other words, the slashes need to be reversed.
Any idea how I can do this?
Thank you
May 15, 2019 at 2:40 pm
Hi, I have found things online about this but nothing is working. I have a field that is a Varchar(20), which holds a Date in it (like this 05/04/2019). I need it to be in this format --> 05\04\2019. In other words, the slashes need to be reversed. Any idea how I can do this? Thank you
Since it is a varchar field, why not do a simple REPLACE
REPLACE(YourFieldName, '/', '\')
May 15, 2019 at 2:42 pm
On a side note, if you have any control over the structure, you would be better off storing the date as a DATE or DATETIME field. Then it can be formatted as needed.
May 15, 2019 at 2:57 pm
On a side note, if you have any control over the structure, you would be better off storing the date as a DATE or DATETIME field. Then it can be formatted as needed.
+100, 'better off' is quite an understatement!
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply