View Full Version : Delete Query


neilmcmor
01-13-2008, 01:38 PM
I am trying to run the following sql but where there should be 54 records for deleting I keep getting 0 records will be deleted. I used an findunmatch query to establish tat there where 54 records unmatched. Can somen tell me whether the sql below is correct. I am Very new at this

DELETE *
FROM Status
WHERE (((Status.Spin) Not In (Select Spin From tbl1)));

pbaldy
01-13-2008, 02:19 PM
It looks okay offhand. There are 54 records in tbl1? If so, you may be running into a referential integrity problem, where there are records in other tables related to the records you're trying to delete.

neilmcmor
01-13-2008, 03:09 PM
there is no relationship as tbl1 is a temp table used for importing excel data

pbaldy
01-13-2008, 03:33 PM
I mean related to the status table, since that's where records are being deleted from.