我得sql语句如下:
CString strSQL ;
strSQL.Format("insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (%d, '%s', %3.8f, %3.8f, %d, %d, %d)", dwMdtID, szTime, (double)dwLong/60000, (double)dwLati/60000, nSpeed, nDirection*2, bStatus);
我想要得到的是:insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (17971, “10:16:02”, 121.42181667, 31.22610000, 0, 0, 3)
可是调试得到的是insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (17971, 10:16:02, 121.42181667, 31.22610000, 0, 0, 3)
我哪里出错了?另外还有一个问题是我如何把当天的日期也加到szTime中?