Hi, if this has not been decided yet. To get the last record for any field from the table, the easiest way would be to add an ID for each record, for example, pID. Also say that in your table you want to write the last entry for each "name", run a simple query
SELECT Name, MAX(pID) as LastID INTO [TableName] FROM [YourTableName] GROUP BY [Name]/[Any other field you would like your last records to appear by]
You should now have a table containing the names in one column and the last identifier available for that name. Now you can use the join to get other data from your main table, say this is some price or date, and do the following:
SELECT a.*,b.Price/b.date/b.[Whatever other field you want] FROM [TableName] a LEFT JOIN [YourTableName] ON a.Name = b.Name and a.LastID = b.pID
Then you should give you the latest entries for each name, for the first entry, follow the same prompts as above, just replace Max with Min above.
It should be easy to follow and should be faster.
source share