skip to Main Content

I want to insert this:

INSERT INTO NAVE (nume, clasa, anul_lansarii) values ('Ticonderoga','Ticonderoga',to_date('02/02/1930','mm/dd/yyyy') );

and gives me the error:

1305 – FUNCTION proiect.to_date does not exist

2

Answers


  1. There is no to_date() function in MySql but you can use str_to_date():

    str_to_date('02/02/1930','%m/%d/%Y')
    

    See the demo.

    Login or Signup to reply.
  2. to_date is not default mysql function.

    But from your question i think you can use STR_TO_DATE function. like this:

    INSERT INTO NAVE (nume, clasa, anul_lansarii) values ('Ticonderoga','Ticonderoga',STR_TO_DATE('02/02/1930','mm/dd/yyyy') );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search