QDate vs MySql: null date
Solved
General and Desktop
-
Hi,
i've to store some date in mysql database tableimporting external txt file i saw that some date can be null and others can be valid date
how can i manage null date in order to store it to the database?QDate do not allow to set it to null (only valid or not valid date)
mysql allow null datei had tried to load the date as text and all works
but i can't order them and can't do any comparison between themany ideas?
-
how can i manage null date in order to store it to the database?
from http://doc.qt.io/qt-5/qsqlquery.html#addBindValue
To bind a
NULL
value, use a nullQVariant
; for example, useQVariant(QVariant::String)
if you are binding a string.