I want to add multiple row values from my table (add up expense values) earlier than a specific date (for example, add all values that are smaller than the 2015-26-06 date). I am using the following code, but it is not functional.
SELECT SUM (VALOR) FROM despesa
WHERE strftime('%Y-m%-d%', data) <= strftime('%Y-m%-d%', '2015-06-30')
AND pago = 1 AND idusuario = 1
Could anyone guide me in this? Thank you in advance.
Expense table structure