I dont have an index on that filed...
I may have got confused on this part
Note this is completely unrelated to the data type you specified when creating the table
CREATE TABLE userlogevents(id INTEGER PRIMARY KEY AUTOINCREMENT, userName TEXT NOT NULL, eventMessage TEXT NOT NULL, dateTime TEXT NOT NULL);
CREATE TABLE userlogevents(id INTEGER PRIMARY KEY AUTOINCREMENT, userName TEXT NOT NULL, eventMessage TEXT NOT NULL, dateTime TEXT NOT NULL);
To copy to clipboard, switch view to plain text mode
My schema is very simple I only have four columns (id, userName, eventMsg, dateTime) the last three fields are text fields ( I wasn’t sure about setting the data type to the dateTime field so I set it to text, above is my table creation sql script )
I have looked into sqlite date() time() functions using the sqlite doc like you mentioned. I have also read else where that you may have issue using other date formats other than YYYY-MM-DD when comparing dates... however I thought maybe there was work around using qt libraries and c++
I believe I do all my comparison in c++ so not sure if that would make a difference
so it sounds like I'm stuck with European dateTime format ? I don't think I will be able to use MM-DD-YYYY format then or use dates with times...
I'm having an issue with an archive fucntion that I just posted that is most likely related to this same issue idk though...
this is what I did to get that part to work earlier, I wanted to keep the variable data type to dateTime but was forced to change them to QStrings and it seem to work okay for selecting data from database however I have run into other issue since then:
QString beginDate
= QDateTime::currentDateTime().
toString("MM-dd-yyyy 00:00:00");
qDebug() << "UserEventLog::selectEvent() beginDate: " << beginDate;
qDebug() << "UserEventLog::selectEvent() endDate: " << endDate;
QString beginDate = QDateTime::currentDateTime().toString("MM-dd-yyyy 00:00:00");
QString endDate = QDateTime::currentDateTime().toString("MM-dd-yyyy 23:59:59");
qDebug() << "UserEventLog::selectEvent() beginDate: " << beginDate;
qDebug() << "UserEventLog::selectEvent() endDate: " << endDate;
To copy to clipboard, switch view to plain text mode
Bookmarks