Hi. I've got fairly simple knowledge when it comes to Access so please go easy on me. I'm currently :banghead: trying to get this to work.
I have a form where the user enteres details about a customer's case. Within that form is a subform for the user to enter the date of every letter received by the customer and the date it was responded to. This is stored on a seperate table to all the other data (to allow for infinite dates to be entered), but both tables are linked using a reference number.
I also have a query that will eventually be used to produce a report for management. The query pulls everything of a certain criteria, but the issue is where there are multiple letters on a case, there are also multiple lines in the query for the same case each with every individual letter received. I need the query to return only the most recent letter received and it's acknowledgement date. If I use the MAX option, it only does the max for date received and doesn't return that entries equivalent responded date - it returns one of the other random responded date.
I hope this makes sense. The query SQL is:
I have a form where the user enteres details about a customer's case. Within that form is a subform for the user to enter the date of every letter received by the customer and the date it was responded to. This is stored on a seperate table to all the other data (to allow for infinite dates to be entered), but both tables are linked using a reference number.
I also have a query that will eventually be used to produce a report for management. The query pulls everything of a certain criteria, but the issue is where there are multiple letters on a case, there are also multiple lines in the query for the same case each with every individual letter received. I need the query to return only the most recent letter received and it's acknowledgement date. If I use the MAX option, it only does the max for date received and doesn't return that entries equivalent responded date - it returns one of the other random responded date.
I hope this makes sense. The query SQL is:
Code:
SELECT [Complaint Summary].[Case Reference], [Complaint Summary].[Customer Name], [Complaint Summary].[Date In], [Complaint Summary].Month, [Complaint Summary].[New or Existing?], [Complaint Summary].Overview, [Complaint Summary].[Issue Type], [Complaint Summary].[Case Manager], [Complaint Summary].[Reason For Contact - CS], [Complaint Summary].[Model Number], [Complaint Summary].Age, [Complaint Summary].Mileage, [Complaint Summary].[Dealer Code], [Complaint Summary].[Latest Update], [Complaint Summary].Status, [Complaint Summary].[Over 3 Weeks], [Complaint Summary].[Goodwill Applied?], [Complaint Summary].[Last Contact], [Complaint Summary].[Next Contact], [Complaint Summary].[Resolved Date], [Complaint Summary].[Closed Date], Correspondence.[Correspondence Received], Correspondence.Acknowledged
FROM [Complaint Summary] LEFT JOIN Correspondence ON [Complaint Summary].[Case Reference] = Correspondence.[Reference Number]
WHERE ((([Complaint Summary].Status)<>"Closed") AND (([Complaint Summary].[Include On MD Log])="-1"));