Reputation: 31
I have a column like this
DATE
"112113"
"011414"
and so on..
I want to remove the first and last characters from the entire DATE column. ie) I want to get rid of these "".
Please help.
Upvotes: 0
Views: 152
Reputation: 1813
Try this:
SELECT SUBSTRING(Date, 2, LEN(Date) - 2) FROM TableName
You could then update the Date column as follows:
UPDATE TableName
SET Date = SUBSTRING(Date, 2, LEN(Date) - 2)
Upvotes: 0
Reputation: 2614
you can do in oracle as answer below
TRIM(BOTH CHR(34) FROM '"011414"')
Result: 011414
or you can use replace("011414",'"');
or you can use SUBSTRING
function also.
as per your requirement..
Upvotes: 0
Reputation:
You can do it with SUBSTRING
that is if you using TSQL.
SUBSTRING(date, 2, LEN(date) - 2)
update: Had parenthesis in the wrong spot
Upvotes: 1
Reputation: 73031
Considering you are only removing the quotes, you might get away with REPLACE()
which compatible with most relational database systems.
SELECT REPLACE(date, '"', '') FROM your_table;
Upvotes: 1