0

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

Community
  • 1
  • 1

2 Answers2

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.

forpas
  • 160,666
  • 10
  • 38
  • 76
0

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') );
ttrasn
  • 4,322
  • 4
  • 26
  • 43