Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't Delete Records Selected in MAX Query 1

Status
Not open for further replies.

jdegeorge

Programmer
Mar 19, 2002
1,313
US
Hi

I have a query based on this SQL:

Code:
SELECT Max(tblIssues.IssueID) AS MaxOfIssueID
FROM tblIssues
ORDER BY Max(tblIssues.IssueID) DESC;

IssueID is set to AutoNum. I want to delete this record but I get an error message

[text]Could not delete from specified tables[/text]

What I'm trying to do with this query is to use it as the basis of another query to delete the last record I added.

How can I either, A) get this query to not have the record be locked, or B) figure out another way to delete the last record added.

Any help would be appreciated. Thanks!

Jim DeGeorge [wavey]
 
A starting point:
DELETE FROM tblIssues
WHERE IssueID = (SELECT Max(IssueID) FROM tblIssues)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Nice!

Thanks, and enjoy the star!

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top