Hello everyone.
Just a thing:
I wish to do a SUM of amounts in a table (column named 'montant':
With this code...
where f is an id in a list ( 'Dim f As Int=li.Get(t)')
appears this message ...
BUT, with this code which is the same operation...
where 'li' is a list containing the id of the table's cities and where I make a reading line by line not using sqlite SUM.
It works perfectly.
I don't think that it's a problem of writing my values.
What about this ? I have read other lines on the web, but I didn't find any answer for this, even if I found a solution.
Just a thing:
I wish to do a SUM of amounts in a table (column named 'montant':
With this code...
sum of the column 'montant':
Dim va As Double=sql.ExecQuerySingleResult( _
' "SELECT SUM(montant) FROM depenses WHERE idlieu = " & f )
where f is an id in a list ( 'Dim f As Int=li.Get(t)')
appears this message ...
B4X:
java.lang.NullPointerException: Cannot invoke "String.trim()" because "in" is null
BUT, with this code which is the same operation...
creating sums for each item in li (list of cities):
For u=0 To li.Size-1
cursor=sql.ExecQuery( _
"SELECT montant FROM depenses WHERE idlieu=" & li.Get(u))
montants(u)=0
Do While cursor.nextrow
montants(u)=montants(u)+cursor.GetDouble("montant")
Loop
montants(u)=Round2(montants(u),2)
Next
where 'li' is a list containing the id of the table's cities and where I make a reading line by line not using sqlite SUM.
It works perfectly.
I don't think that it's a problem of writing my values.
What about this ? I have read other lines on the web, but I didn't find any answer for this, even if I found a solution.