Srujana
Srujana

Reputation: 1

Conversion of any format of date in mysql 8.0

I am trying to insert values into a table:

INSERT INTO EMP VALUES (7876,'ADAMS','CLERK',7788,convert(datetime,'13-JUL-2019',101),1100,NULL,20);

But I receive the error below:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''13-JUL-2019',101),1100,NULL,20)' at line 1.

Tried different syntaxes, however I couldn't solve this. Please some one help. Thank you.

Upvotes: 0

Views: 236

Answers (1)

slaakso
slaakso

Reputation: 9070

The convert(datetime,'13-JUL-2019',101) syntax is for MS SQL Server / Sybase.

Instead, use STR_TO_DATE.

Upvotes: 1

Related Questions