Sprinks wrote:
[Quoted Text] > How about: > > SELECT MyTable.recID, MyTable.CustID, MyTable.InDate, MyTable.Comments, > > (Select Comments From MyTable as MyDupe Where RecID = > (SELECT Max([recID]) AS LastRec > FROM MyTable as dupe > WHERE dupe.CustID=MyTable.Custid and dupe.RecId<MyTable.RecID) ) AS > LastComment > FROM MyTable; > > This should give a list of all entries with a LastComment field > containing that customer's previous comment. This assumes that RecID is > a sequence number and that entries are made in date order.
Thank you Sprinks, I appreciate your help. I copied your code to my query, but received error message regarding the syntax. Since I am not good at the SQL, I don't know how to fix it.
Still I want to thank you!
Elaine
|