1
I am wanting to add up values from several rows of my table (add up expenditure values) prior to a specific date (for example, add up all values that are lower than the date 2015-26-06). I’m using the following code, but it’s 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 someone guide me in this? I thank you in advance.
Structure of the Expenditure table
"but he’s not functional." What do you mean by that?
– PauloHDSousa
that it returns me null, that is, it adds nothing, it is not functional.. @Paulohdsousa
– Allan Chrystian
it is functional, you are passing the parameter wrong way. just convert the date correctly. The base is populated?
– PauloHDSousa
is yes, I copied it from the emulator to test the commands using Sqlite Browser, would you have any conversion tips? @Paulohdsousa
– Allan Chrystian
@Paulohdsousa would have some way to search without the day? only use year and month?
– Allan Chrystian
Yes, there is a way.
– PauloHDSousa
and how would that be? @Paulohdsousa
– Allan Chrystian