richo,
I have no idea of the structure of your tables, but here's a general example, using a structure that may be close to yours. There are 2 possibilities here--one easy--if the structure is done in a way that would facilitate this, the other is more complex.
First:
tblAdNotes
NoteID Autonumber 'Primary key, high#r is latest Note--this makes it easy
AdvertiserID Number 'Foriegn key to Advertiser table
Note Text or memo 'the actual note
NDate Date 'The date/time of note (If date only, it's not unique)
First SQL example:
SELECT tblAdNotes.NoteID, tblAdNotes.AdvertiserID, tblAdNotes.Note, tblAdNotes.NDate
FROM tblAdNotes
WHERE tblAdNotes.NoteID In (select max(noteid) as dt from tbladnotes B where B.advertiserid = tbladnotes.advertiserid)
The above assumes NoteID is sequential, and therefore highest one is latest note--this makes it easy to do a sub-select. Note we only alias the subselect table as B, but you can always alias both.
Second syntax. This would be needed if NoteID was, for some reason, not sequential, or in cases where, say, notes from previous dates were entered at a later time, getting a higher ID but lesser date. Also, in this case the Note Date may a date only, thus many 'last notes', which requires that we can only randomly choose one--even if it's date/time, it still may not be unique. So the First() is what randomly chooses a NoteID that is in the set of highest dates. It's the best we can do if these are the circumstances:
SELECT A.NoteID, A.AdvertiserID, A.Note, A.NDate
FROM tblAdNotes AS A
WHERE A.NoteID In (SELECT First(B.NoteID) AS FirstOfNoteID
FROM tblAdNotes B
WHERE B.AdvertiserID=A.ADVERTISERID
GROUP BY B.ndate,B.advertiserid
HAVING B.NDate In (select max(ndate) from tblAdNotes C
WHERE C.advertiserID = B.Advertiserid) )
Above the same table is here 3 times, aliased as A, B, and C. The performance may be slow if the table is large and not indexed well. Let me know if this helps,
--Jim