mattn / go-adodb

Microsoft ActiveX Object DataBase driver for go that using exp/sql
http://mattn.kaoriya.net/
MIT License
142 stars 36 forks source link

GUID datetime INSERT #17

Closed gzw13999 closed 9 years ago

gzw13999 commented 9 years ago

id is GUID uniqueidentifier [receivetime], [completetime] is datetime

INSERT INTO [topic]([id],[receivetime], [completetime]) VALUES ('03fc4c83-dae6-4273-aae9-fb50c30248ab','2015-01-27 19:56:42.798', '2015-01-27 19:56:45.792') successful!!!!

s, err := models.Db.Prepare(“INSERT INTO [topic]([id],[receivetime], [completetime]) VALUES (?,?,?)”)

s.Exec(id,receivetime,completetime)

failure???

gzw13999 commented 9 years ago

s, err := models.Db.Prepare(“INSERT INTO topic VALUES (?,?)”)

s.Exec(receivetime.Format("2006-01-02 15:04"),completetime.Format("2006-01-02 15:04"))

successful!!!!

gzw13999 commented 9 years ago

.Format("2006-01-02 15:04") But such accuracy is not enough

gzw13999 commented 9 years ago

thank