Unmatched query without wizard?

  • Thread starter Thread starter C Tate
  • Start date Start date
C

C Tate

Can I create an unmatched query without the wizard being installed? My
version of Access at work doesn't have it. IT dept takes ages to install
anything!

I have a list of client numbers consisting of a single column in Excel. I
have linked this to Access and wish to delete all the client information in
the Access table which are NOT in the excel list. The Access table contains
many many columns only one of which contains the client number. However I
wish to delete all the fields in the table.

How can I do it?

Thanks in advance.
 
Assuming that your table in Access is called AccessTable and that all the fields with client information are called Client:

DELETE AccessTable.Client
FROM Client LEFT JOIN AccessTable
ON Client.Client = AccessTable.Client
WHERE AccessTable.Client Is Null;
 
Can I create an unmatched query without the wizard being installed? My
version of Access at work doesn't have it. IT dept takes ages to install
anything!

I have a list of client numbers consisting of a single column in Excel. I
have linked this to Access and wish to delete all the client information in
the Access table which are NOT in the excel list. The Access table contains
many many columns only one of which contains the client number. However I
wish to delete all the fields in the table.

Do you want to "delete all the fields" - i.e. leave the record intact
and update all the fields to NULL - or (permanently and irrevokably)
delete the record from the table?

If the latter, you should be able to use:

DELETE * FROM yourtable
WHERE ClientID NOT IN
(SELECT ClientID FROM LinkedExcelTable);
 
Back
Top