Thanks you very much, I done.
QSqlQuery q
("select count(MaDaiLy) as SoDaiLyTrongQuan from DaiLy, Quan where DaiLy.Quan_TenQuan = Quan.TenQuan and Quan.TenQuan = '" + ui.
cbTenQuan->currentText
() + "'");
int nameCol = rec.indexOf("SoDaiLyTrongQuan"); // index of the field "name"
q.next();
int SoDLHienCoTrongQuan = q.value(nameCol).toInt();
QSqlQuery q("select count(MaDaiLy) as SoDaiLyTrongQuan from DaiLy, Quan where DaiLy.Quan_TenQuan = Quan.TenQuan and Quan.TenQuan = '" + ui.cbTenQuan->currentText() + "'");
QSqlRecord rec = q.record();
int nameCol = rec.indexOf("SoDaiLyTrongQuan"); // index of the field "name"
q.next();
int SoDLHienCoTrongQuan = q.value(nameCol).toInt();
To copy to clipboard, switch view to plain text mode
the result is return: 2
Bookmarks