Sum of accounts received by date column

Asked

Viewed 25 times

0

I am unable to add values from the second column per date. The query returns repeated dates.

select dtlancamento, sum(vrlancamento) as Total_contas_recebidas from cashier Inner Join person on box.idempresa = person.idperson Where dtlancamento between '2021-01-04 00:00:00' and '2021-01-04 23:59:59' and financial accounting in ('1') and tpprocedncia in ('P') and dtcanceled is null group by dtlancamento

Return:

inserir a descrição da imagem aqui

  • You are considering the timestamp (date and time) field. Do GROUP BY only for the date part, for example: date_trunc(dtlancamento, 'day').

  • Thanks for the information, I was able to run the query by period.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.