Delete records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have tables with IdRecord and another fields.
I would like to delete all records with only IdRecord and without data in
remaining fields.

Is it possible, please?

Thanks in advance.
an
 
DELETE *
FROM TableName
WHERE IdRecord Is Not Null AND
FirstOtherField1 Is Null AND
FirstOtherField2 Is Null AND
FirstOtherField3 Is Null AND
FirstOtherField4 Is Null AND
FirstOtherField5 Is Null AND
FirstOtherField6 Is Null AND
FirstOtherField7 Is Null AND
FirstOtherField8 Is Null AND
FirstOtherField9 Is Null AND
FirstOtherField10 Is Null AND
FirstOtherField11 Is Null AND
FirstOtherField12 Is Null AND
FirstOtherField13 Is Null AND
FirstOtherField14 Is Null AND
FirstOtherField15 Is Null AND
FirstOtherField16 Is Null AND
< continue with all other fields >
;
 
KS,

Thank you very much for reply and help.
an

Ken Snell (MVP) said:
DELETE *
FROM TableName
WHERE IdRecord Is Not Null AND
FirstOtherField1 Is Null AND
FirstOtherField2 Is Null AND
FirstOtherField3 Is Null AND
FirstOtherField4 Is Null AND
FirstOtherField5 Is Null AND
FirstOtherField6 Is Null AND
FirstOtherField7 Is Null AND
FirstOtherField8 Is Null AND
FirstOtherField9 Is Null AND
FirstOtherField10 Is Null AND
FirstOtherField11 Is Null AND
FirstOtherField12 Is Null AND
FirstOtherField13 Is Null AND
FirstOtherField14 Is Null AND
FirstOtherField15 Is Null AND
FirstOtherField16 Is Null AND
< continue with all other fields >
;
 
Hi An,

You did replace all the fieldnames Ken wrote down for your own field names
right? If you did post you query statement so we can take a look at it to
help you further...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top