Tag: Tip

  • Convert string from dd/mm/yyyy to yyyy-mm-dd using mysql

    I had a large dataset with all the date fields in the format DD/MM/YYYY. I needed to convert them to YYYY-MM-DD . I ran the following queries: UPDATE TABLE_NAME SET FIELD_NAME = replace(FIELD_NAME, ‘/’, ‘-‘); UPDATE TABLE_NAME SET FIELD_NAME = str_to_date(FIELD_NAME,’%d-%m-%Y’); Hope it helps…