I have a question that may be trivial for most, but that I got stuck here, I look for a lot of research before posting, but I'll need a help.
I'm building a select to bring me the closing of the results with base date, for this I need, for example, to take as base 12/31/2015, in the structure of the database the tables that will be queried will be document , the document table contains the generated documents and document_pgto records payment events (1 or more) for each document.
Thanks