user1777711
user1777711

Reputation: 1744

MYSQL Date Time Insert issue

This is my sql line

I tried:

INSERT INTO delivery (Manifest_Id, , Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP',2013-10-23 14:00:00,2013-10-23 18:00:00)

and this

INSERT INTO delivery (Manifest_Id, , Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP','2013-10-23 14:00:00','2013-10-23 18:00:00')

Both return me

 #1064 - 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 ' Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP',2013-10' at line 1

My table structure is

delivery_id as int with auto increment ( not the issue )
Manifest_id as varchar
Expected_Start_DateTime as datetime
Expected_End_DateTime as datetime

ISSUE SOLVED.

I got an extra comma in my line.

Upvotes: 0

Views: 40

Answers (2)

Sashi Kant
Sashi Kant

Reputation: 13465

There is an extra comma in your insert query remove that

Try this::

INSERT INTO delivery (Manifest_Id, Expected_Start_DateTime, Expected_End_DateTime) VALUES ('SGP1361645SGP',2013-10-23 14:00:00,2013-10-23 18:00:00)

Upvotes: 1

juergen d
juergen d

Reputation: 204756

Remove the comma

INSERT INTO delivery(Manifest_Id, Expected_Start_DateTime, Expected_End_DateTime)
VALUES ('SGP1361645SGP','2013-10-23 14:00:00','2013-10-23 18:00:00')

Upvotes: 2

Related Questions