No need for SQL statements or scripts. You can do all of that using the native PlanetPress Workflow Tools.

You should create a process that runs at regular intervals (say, every Saturday night). The process starts with a Find Capture Document input task in which you can specify the conditions that will determine which PDF's should be removed from the database.

The Process will then loop through every single result from the Find Capture Document query. So immediately following the input task, you can simply add a Get Capture document task with the Close document after retrieval option ticked.

Then, end the process with a Delete task.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen