I have two tables relating to queries sent in by customers and responses made to them. There can be multiple questions asked and multiple responses given.
What i'm trying to achieve is being able to calculate the time taken between question raised and the response.
However, i'm getting results that show all responses to each question asked. Each question and response has a unique identifier - ACTION_ID.
this is my query....
I've attached the current outcome. The problems are the lines in yellow. This customer asked a Q on 2nd June and received a response the same day. They then asked a second question and received a second reply. However, 4 lines are being displayed. How do I ammend the query so that the "duplicates" in yellow arent outputed.
Hope this makes sense, and thanks in advance.
What i'm trying to achieve is being able to calculate the time taken between question raised and the response.
However, i'm getting results that show all responses to each question asked. Each question and response has a unique identifier - ACTION_ID.
this is my query....
Code:
SELECT DISTINCT Question_Created.CUSTOMER_ID, Question_Created.Question_Date, Question_Created.ACTION_ID, Question_Responded.Response_Date, Question_Responded.ACTION_ID
FROM Question_Created LEFT JOIN Question_Responded ON Question_Created.CUSTOMER_ID = Question_Responded.CUSTOMER_ID
ORDER BY Question_Created.CUSTOMER_ID, Question_Created.ACTION_ID, Question_Responded.ACTION_ID;
I've attached the current outcome. The problems are the lines in yellow. This customer asked a Q on 2nd June and received a response the same day. They then asked a second question and received a second reply. However, 4 lines are being displayed. How do I ammend the query so that the "duplicates" in yellow arent outputed.
Hope this makes sense, and thanks in advance.