Skip to content
Advertisement

SQLite: select from column by month

I am trying to sum a tablecolumn on basis of month but I got the following exception:

JavaScript

the function

JavaScript

the table

JavaScript

In the debugger the cursor contains one item but when calling getInt(..) the app crashes

Advertisement

Answer

The column created for this result:

JavaScript

is not called Total.
Change the sql statement to this:

JavaScript

This way you give the name (alias) Total to the column.
Or since there is only 1 column returned, do this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement