Hello,
I have this situation:
query.prepare("SELECT * FROM mytable");
query.exec();
query.first();
while (query.next())
{
value = query.value(0).toString();
cout << value.toStdString() << "\n";
}
in my output i get the 2 values below:
50.450,50
85.336,50
QSqlQuery query;
query.prepare("SELECT * FROM mytable");
query.exec();
query.first();
QString value = "";
while (query.next())
{
value = query.value(0).toString();
cout << value.toStdString() << "\n";
}
in my output i get the 2 values below:
50.450,50
85.336,50
To copy to clipboard, switch view to plain text mode
with SQL i can do it as below:
"SELECT TOTAL(myfield) FROM mytable"
"SELECT TOTAL(myfield) FROM mytable"
To copy to clipboard, switch view to plain text mode
but i need to do it in my C++ code, so
How could I sum these type of values in my while clause?
Thanks
Juliano
Bookmarks