0
Display statement of a particular account with the respective movements of a 15 days prior to the request date with the following data:
- Agency;
- Account number;
- Name of the account holder;
- Account holder identification (CPF or CNPJ);
- Account type;
- Account situation;
- Type of movement;
- Date of movement;
- Movement value;
- Account balance.
I implemented this view:
create view v_extrato_conta as
select c.agencia,
c.numero_conta,
t.nome,
t.CPF_CNPJ,
c.tipo,
c.estado_conta,
m.operacao,
m.data_movimento,
m.valor,
c.saldo
from conta c
inner join correntista t
on c.idconta = t.idcorrentista
inner join movimento m
on c.idconta = m.idmovimento;
and I created this project to call this view:
delimiter #
create procedure exibi_extrato_conta(data_solicitacao date)
begin
select * from v_extrato_conta where data_solicitacao < 15;
end
#
but I can’t get back any data if I withdraw the condition of data_solicitacao < 15
and pass any request date and call Procedure, it brings me the data. How could I do this query by decreasing 15 days from data_solicitacao
? I hope you can help me.
If
data_solicitacao
is a parameter of your precedent what is the sense of using such a parameter in your query compared to a constant? Shouldn’t you check ifdata_movimento
is in the period of 15 days prior todata_solicitacao
?– anonimo