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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETE QUERY QUESTION

Status
Not open for further replies.

blindlemonray

Technical User
Nov 24, 2003
130
GB
Can anyone help. I have an sql statement which is

SELECT TOP 1000000 C2.*
FROM CONTACT2 C2
WHERE (ACCOUNTNO = '')

But what I would like to do is delete these records as well. I know you cannot use the top statement with delete query!!

Has anyone got any ideas!!

Thanks in advance
[ponder]
 
Use a make-table query based on your Top query to create a temporary table.

Then use a delete query to delete the records in your orignal table where there is a join to the temporary table by common primary key fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top