Since I've already been asked once, and I'm sure to lose it myself, here's the query I run in phpMyAdmin on my osticket database to dump a query out that I simply dump into MS Access.  Mod to suit your needs:

SELECT  `ticketID`,  `email`, `name`, `subject` , ost_comment.* FROM `ost_ticket` join (SELECT `ticket_id` , concat( "R", `response_id` ) AS commentid, `staff_name` , `response` AS
COMMENT , `invdate` , `invtime` , `invtype`
FROM `ost_ticket_response`
UNION
SELECT `ticket_id` , concat( "C", `note_id` ) , `source` , concat( `title` , " – ", `note` ) , `invdate` , `invtime` , `invtype`
FROM `ost_ticket_note`  ) as ost_comment on ost_ticket.ticket_id = ost_comment.ticket_id where invtime>0

 

Verified by MonsterInsights