2013-10-23 113 views
0

这是我的SQL线MYSQL日期时间插入问题

我想:

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) 

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') 

两个回我

#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 

我的表结构

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

问题是否已解决。

我在我的行中得到了一个额外的逗号。

回答

2

删除逗号

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') 
+0

噢,对不起。没有意识到我有一个额外的逗号。谢谢 – user1777711

1

。在你的插入查询一个额外的逗号删除

试试这个::

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) 
+0

对不起。没有意识到我有一个额外的逗号。谢谢 – user1777711