Could you add a field for the Date/Time of entry or do you just get given the data in a batch? It is quite easy to find the oldests record and exlcude that in the query.
I actually have that data and could use it, but the "first" record in the dataset that's generated is "first" by other criteria than that, so that date method would choose the wrong record to delete if I included and used it.
Maybe if I do a better job of explaining, it will help you folks help me.
Attached is a sample of data in an Excel sheet, zipped up, that might help with the explanation. It's the first 19 records of more than 18,000 in the table that was appended into the empty temp table as follows:
The query that gets run to put together the dataset for the temp table above sorts the data in a particular manner, with the [PoleNumber] grouped and then sorted as you see (It is "1" only in this example - In fact it will almost never be the same set of [PoleNumber] data twice from run to run).
It also sorts those groups of [PoleNumber] by [PoleCalcPr] so that the lowest [PoleCalcPr] number is at the top of each [PoleNumber] group. That number will always be a zero and the [Device Type] will always be a 36, but there will be hundreds or even thousands of those in the table, 1 for each group of [PoleNumber]. I need to keep all of them except that very first, top one, and I need to keep (or end up with) the sort order for the table as is.
It then appends that sorted recordset into the temp table, which has an autonumber [ID] for reference and to provide a final sort order to the table itself. (While I'm at it, I'd like to re-set that to 1 each time this thing runs).
Now that I've got my TempPoleMeas02 table populated with the data, I need to delete the very first record from it, [ID] 18870 in this case. If I can figure out a way to just not include it in the dataset in the query that appends the table, that's fine too, as long as the end result is the same - all the data, except that one single record.
Any ideas on how to accomplish this are greatly appreciated!