Skip to content
Advertisement

Extract date from a column

How to extract date from a string like ‘2:24 PM 6-20-2021’?

For example, I have a column called Dates (datatype ‘String’) in the table like below –

The output should be

Advertisement

Answer

How to extract date from a string?

If you want to extract date as a date type so you will be able then to use data functions – consider below

if applied to sample data in your question – output is

enter image description here

Meantime, if you want to extract data as a string (as it is in original string) – consider below

with output

enter image description here

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement