Results 1 to 2 of 2
Nov 26, 2008, 23:34 #1
Need to create a report from 2 Tables but getting Error messages
I need to create a report looking at 2 different Tables.
Lets say table 1 is called "support_ticket", this table contains the main info about a new support ticket, such as:
Author, Date_Posted, Author_ID, Address , etc.
Table 2 contains the messages posted and replies posted to the messages, it is called table "replies" and it contains info such as:
Reply_Author, Reply_Message, Reply_date, Reply_to_what
So here is what I need to do:
create a report which lists those new Tickets that have been opened which have not been answered?
I tried this but it is not working:
SELECT id, LEFT(subject, 40) AS mini_subject , author, status, date_added FROM support_ticket, replies
WHERE support_ticket.id = replies.support_id
AND MAX(reply_date) IS NULL
GROUP BY id;
Your help is greatly appreciated.
Anoox search engine volunteer
Nov 27, 2008, 01:03 #2
- Join Date
- Jan 2004
- Uppsala, sverige
- 2 Post(s)
- 1 Thread(s)
select id, left(subject, 40) AS mini_subject , author, status, date_added from support_ticket where not exists (select * from replies where support_ticket.id = replies.support_id)