diff --git a/print/templates/email/osticket-report/sql/tickets.sql b/print/templates/email/osticket-report/sql/tickets.sql index bc118a65f..4056298e1 100644 --- a/print/templates/email/osticket-report/sql/tickets.sql +++ b/print/templates/email/osticket-report/sql/tickets.sql @@ -19,8 +19,9 @@ SELECT * FROM ( AND ote.type = 'M' LEFT JOIN ost_thread_entry oter ON oth.id = oter.thread_id AND oter.type = 'R' - WHERE ots.state = 'closed' - AND closed BETWEEN ? AND ? + WHERE ot.ticket_pid = NULL + AND ots.state = 'closed' + AND otc.closed BETWEEN ? AND ? ORDER BY oter.created DESC ) ot GROUP BY ot.ticket_id ORDER BY ot.assigned \ No newline at end of file