I am using org-mode to manage my tasks and the logbook functionality to log my hours as I work on tasks. At the end of the month, I compile the time I spent using clocktables. When I deem a task as "complete", I toggle the item "DONE" (C-c t d).
I am now looking for a way to archive (to a separate file) all those headlines that are marked as "DONE", and have no Logbook entries after a given date (for example, the start of this month.) That would allow me to safely archive older headlines without the risk of archiving unbilled hours.
So far I have been looking into
C-c a < m with a query something like
tasks+TODO="DONE"+CLOSED<"[2019-08-01]" (I got this from here: http://jcardente.blogspot.com/2010/06/org-mode-hack-tasks-done-last-month.html.) The "CLOSED" part of the query does not seem to be working, and even if it was, I think filtering based on the Logbook would be safer. However, I after an hour of trying and finding nothing using Google, I figured asking is my best option.