summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-09-30 05:31:48 (GMT)
committerBill King <bill.king@nokia.com>2009-09-30 05:31:48 (GMT)
commit1ceaa588f254888e0d9cf73e8d094dfdb8f3b8ab (patch)
tree61336b310c9683e0fa9a3103ebd6f51c23f1ee3f /src/sql/drivers
parent9a7624ce5c4f78f89408eb0d9a33b1cd1569eb3c (diff)
downloadQt-1ceaa588f254888e0d9cf73e8d094dfdb8f3b8ab.zip
Qt-1ceaa588f254888e0d9cf73e8d094dfdb8f3b8ab.tar.gz
Qt-1ceaa588f254888e0d9cf73e8d094dfdb8f3b8ab.tar.bz2
(TDS) Fixes improper formatting of date values
Task-number: QT-754
Diffstat (limited to 'src/sql/drivers')
-rw-r--r--src/sql/drivers/tds/qsql_tds.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp
index dddc1b4..8acd599 100644
--- a/src/sql/drivers/tds/qsql_tds.cpp
+++ b/src/sql/drivers/tds/qsql_tds.cpp
@@ -747,7 +747,9 @@ QString QTDSDriver::formatValue(const QSqlField &field,
r = QLatin1String("NULL");
else if (field.type() == QVariant::DateTime) {
if (field.value().toDateTime().isValid()){
- r = field.value().toDateTime().toString(QLatin1String("'yyyyMMdd hh:mm:ss'"));
+ r = field.value().toDateTime().toString(QLatin1String("yyyyMMdd hh:mm:ss"));
+ r.prepend(QLatin1String("'"));
+ r.append(QLatin1String("'"));
} else
r = QLatin1String("NULL");
} else if (field.type() == QVariant::ByteArray) {