I am pretty new so please be patient.
How would I get the sum of some fields in the db and place the total into a variable? If I run this statement I can see all of the amounts in a messagebox but for some reason I just can't seem to figure out how to make it total and place it into a variable.
I have tried the statement below but it gives me errors. One says that column 'amount' does not exist and the other one is an invalid double:"".
How would I get the sum of some fields in the db and place the total into a variable? If I run this statement I can see all of the amounts in a messagebox but for some reason I just can't seem to figure out how to make it total and place it into a variable.
B4X:
dbCursor = SQL1.ExecQuery("SELECT amount FROM panels WHERE vehid = " & lblVehID.Text)
I have tried the statement below but it gives me errors. One says that column 'amount' does not exist and the other one is an invalid double:"".
B4X:
dbCursor = SQL1.ExecQuery("SELECT SUM(amount) as total_price FROM panels WHERE vehid = " & lblVehID.Text)
vehtotal = total_price
Last edited: