Today I can do the query 10 days ago as shown in the query below, I just can not deploy the 10 days ahead of the current date.
SELECT
'vw_saldobancario'.'contaApelido',
'vw_saldobancario'.'tipoMovimento',
'vw_saldobancario'.'historico',
(
vw_saldobancario.debitosPendentes + vw_saldobancario.debitos
) AS debitos,
(
vw_saldobancario.creditosPendentes + vw_saldobancario.creditos
) AS creditos,
'vw_saldobancario'.'dataMovimento',
'vw_saldobancario'.'conta_bancaria_id',
IF (
creditosPendentes > 0
OR debitosPendentes > 0,
'SIM',
'NAO'
) AS Pendentes
FROM
'vw_saldobancario'
WHERE 'dataMovimento' BETWEEN DATE_ADD(CURRENT_DATE(), INTERVAL -10 DAY) AND CURRENT_DATE()
AND 'conta_bancaria_id' = 3
GROUP BY 'idHistorico'