Skip to content
Advertisement

How can i change SQL date format to: 12th Jun 2021. (as example)

So, I’m trying to insert data from .csv file, but because of the date format I’m using – import causes it to set to 00-00-0000

import settings: format – CSV using load data (otherwise it causing errors and failing to import) Specific format options: none

Errors I’m receiving after import:

  • Data truncated for column… my_date sets to 0000-00-00, even with ‘DD/MMM/yyyy’ date format,

my csv file structure: (just in case if i need to use specific format)

name;1;1st Jan 2021;2st Jan 2021;;;;;;;;;;;;;

Technically, I could format it manually to 12 jun 2021 / 12.06.2021 / 12/06/2021 but I would like to avoid that.

Sorry if it’s a dumb question and the answer is simple, but I have no idea how to fix it. 🙂

I already tried this but still nothing.

Advertisement

Answer

Maybe you should import your date columns as text data type, and make transformations later! Please follow this steps:

Import Wizard

Import Wizard

Then Update your columns:

Then Change data type to DATE(or preferably date time):

If we check the data,

If we check the datatype to ensure that It is date:

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