cancel
Showing results for 
Search instead for 
Did you mean: 

MAX display only the newest record

kangdinh
Discoverer
0 Kudos
262

I have two tables, one just a customer information and the other is all the casenotes tie to that customer.  I just want to see the latest casenote ONLY for my customer.  I create this query but it giving all the casenotes.  Please help.

SELECT
c.userID,
c.FirstName,
c.LastName,
MAX(cn.noteDate) as "Last CN Date"
FROM UsercustomerDetails c
LEFT JOIN Casenotes cn
ON c.UserID=cn.UserID
Where c.userid='309277851'
GROUP BY c.UserID, c.FirstName, c.LastName,cn.noteDate,cn.title,cn.note

Result:

kangdinh_0-1735602020809.png

I need to make it display the last record only.

 

View Entire Topic
Sandra_Rossi
Active Contributor
0 Kudos

(removed)

HunorCzaka
Explorer
0 Kudos
This should work, did you try it out?
Sandra_Rossi
Active Contributor
0 Kudos
@HunorCzaka Thanks, my bad, I incorrectly read the question, answer removed (as far as I can).