View Tickets,Type, Status, Attachement Query

Moderator: crythias

Locked
jgarcia
Znuny newbie
Posts: 5
Joined: 27 Jun 2011, 06:33
Znuny Version: 3.0.8
Real Name: John
Company: Pixels on IT
Contact:

View Tickets,Type, Status, Attachement Query

Post by jgarcia »

Hello all,

Can someone please take a look at the following query and let me know what I'm doing wrong. It supposed to show all tickets regardless if they have attachments are closed or open. The query works fine but it only brings the last two columns.

Code: Select all

SELECT t.id AS ID, t.tn AS 'Ticket No.', t.title AS Title, q.name AS Category, tt.name AS 'Incident', t.customer_id AS Customer, t.create_time AS 'In Call', a.change_time AS 'Closed In', aa.filename AS 'Service Order'
FROM article a LEFT JOIN article_attachment aa ON a.id = aa.article_id LEFT JOIN queue q ON a.id = q.id LEFT JOIN ticket t ON a.id = t.id AND q.id = t.queue_id LEFT JOIN ticket_state ts ON t.ticket_state_id = ts.id LEFT JOIN ticket_type tt ON t.type_id = tt.id
thanks in advanced for all the help.
John Garcia
Pixels on it | Dress up functionality.
Locked