My database:
My code:
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("sqlite.db");
db.open();
QSqlQuery query;
query.exec("SELECT * from Expenses");
QSqlTableModel *model = new QSqlTableModel(0, db);
model->setTable("Expenses");
model->select();
How I can to get the value of TOTAL for "January 2014"? I.e. "1".
http://doc.qt.io/qt-4.8/qsqltablemodel.html#details
http://doc.qt.io/qt-4.8/qsqltablemodel-members.html
http://doc.qt.io/qt-4.8/qsqlquerymodel.html#record
http://doc.qt.io/qt-4.8/qsqltablemodel.html#rowCount
or
Hope that helps.