rtorres Posted October 7, 2023 at 12:54 AM Report Share #631899 Posted October 7, 2023 at 12:54 AM Estou a desenvolver uma listagem detalhada do movimento da conta corrente, e estou com problemas ao calcular o valor do saldo do intervalo de datas. Exemplo: Data | Data vencimento | Doc | Doc Nº | Débito | Crédito | Saldo 2021-10-01 | 2021-11-01 | Fatura | 2 | -10€ | 0 | -100€ 2021-09-01 | 2021-10-01 | Recibo | 1 | 0 | 20 | -90€ 2021-09-10 | 2021-10-01 | Fatura | 1 | -110€ | 0 | -110€ A consulta para obter o saldo em aberto da conta corrente esta a funcionar, o problema esta na consulta para preencher a coluna do saldo. Alguém já implementou ou pode-me ajudar nas consulta ? Link to comment Share on other sites More sharing options...
pc.cesar Posted November 27, 2023 at 11:41 AM Report Share #632213 Posted November 27, 2023 at 11:41 AM select no, nome, datalc, dataven, cmdesc, nrdoc, ecred, edeb, sum(ecred-edeb) over(partition by no order by no, datalc) from cc César Faria Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now