0

I have data in a column of string type value.

For example : string value : 20201123043000 i need to get timestamp value : 2020-11-23 04:30:00

How can i write sql query to get above timestamp. Thanks

1
  • 2
    Storing dates as strings is a major design bug. You should be looking for ways to replace that string field with a proper date field. If this is a new application, simply fixing the bad type would be enough and no conversion would be needed Commented Nov 24, 2020 at 8:17

1 Answer 1

2

You can use TO_TIMESTAMP function

SELECT TO_TIMESTAMP('20201123043000','YYYYMMDDHHMISS');
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.