Hi Allen,
Thank you for helping me with this. I really appreciate. Since I am new,
I
will start over. Disregard what I said before.
OK...I have a query that reads like this:
DELETE [Schedule Enrollment].[Schedule #], [Schedule Enrollment].[Customer
#]
FROM [Schedule Enrollment]
WHERE ((([Schedule Enrollment].[Schedule #])=[Forms]![Schedule Enrollment
subform]![Schedule #]) AND (([Schedule Enrollment].[Customer
#])=[Forms]![Schedule Enrollment subform]![Customer #]));
So, if it finds Schedule # 677 in Schedule Enrollment and 677 in Schedule
Enrollment subform AND Customer # 5511 in Schedule Enrollment and 5511 in
Schedule Enrollment subform,..............
it deletes every instance of when that is found. Where I just want it to
delete the last instance of that criteria when it is found.
Do you know how I can change that?
Thanks Again
Allen Browne said:
This example assumes a primary key field named ID, and the maximum value
is
found in SomeField:
DELETE FROM Table1
WHERE ID =
(SELECT TOP 1 ID
FROM Table1 AS Dupe
ORDER BY Dupe.SomeField DESC,
Dupe.ID DESC)
If subqueries are new, here's an introduction:
http://allenbrowne.com/subquery-01.html
Hi
I was wondering if anyone could help me. I have a query that finds the
last
entry of a certain field.
Is there a way for me to create a query that would delete this last
entry
that the above query found?