2013-10-23 148 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