SQLite handles datetimes in a different way than other databases. It does not have specific storage classes but stores them as
TEXT
,
REAL
, or
INTEGER
(see
Datatypes In SQLite Version 3[
^]).
You have to pass the data acording to the used storage class and/or use one of the
SQLite Query Language: Date And Time Functions[
^].
Untested example:
query.prepare("SELECT PassID,STARTDATE,ENDDATE,INTIME,OUTTIME FROM ISSUEPASS WHERE date(STARTDATE) BETWEEN ? AND ?");
query.addBindValue(date2.toString(Qt::ISODate));
query.addBindValue(date3.toString(Qt::ISODate));