0

I have comma separated value like 2018-06-20 01:12:53,2018-06-20 01:14:11 But the problem is I need date and time format like day-month-Year H:i when I use DATE_FORMAT(t1.pickup_date_time, "%d-%m-%Y %H:%i") it could not run because the column(pickup_date_time) has comma separated value. Your help is appreciated.

Thank you.

Shadow
  • 33,525
  • 10
  • 51
  • 64
sumanta.k
  • 498
  • 1
  • 8
  • 26

1 Answers1

2

Use SUBSTRING_INDEX first to split the column on the comma. Then use STR_TO_DATE to reformat the date. If you have issue with the actual code, let me know.

Bleach
  • 561
  • 4
  • 11