SELECT
t.subject AS `Ticket Subject`,
t.ticket_number AS `Ticket ID`,
d.name AS `Department`,
t.status AS `Ticket Status`,
t.name AS `Submitter Name`,
t.email AS `Submitter Email`,
t.`date` AS `Ticket Date`,
t.resolve_date AS `Ticket Due Date`
FROM hb_tickets t
JOIN hb_ticket_departments d ON ( t.dept_id = d.id )
WHERE t.status != 'Closed'
AND
t.resolve_date!='0000-00-00 00:00:00'
AND
t.resolve_date < NOW()