How to handle more than 64 criteria's in a query

graphage

Board Regular
Joined
Mar 7, 2002
Messages
87
I am working with a large database of items that we sell (50,000 items). I have been given a list of about 1000 random items that need be be removed. It seems to me that the max number of items I can enter into a query is 64. I also tried to go into the sql (rather than the regular query window), but I still seemed to hit the limit. Is there any way around this? I don't want to have to creat 15+ queries.....

Thanks in advance!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Do you have the items you want to remove in another table?

If you do you could join the existing table with that on the ItemID (or whatever the common unique identifier is) and then use that to delete records.
 
Upvote 0
Can you give more information?

How is your data is structured?

Does each product have a unique ID?

What are you actually trying to delete?
 
Upvote 0
For simplicity, this is what I have:

MasterItemTable: Item#, ItemDesc

ExclusionTable: Item#

An item number is 6 digits long and they are each listed one time. I need to delete the line that represents the item.
 
Upvote 0
How about this?

DELETE MasterItemTable.ItemID, MasterItemTable.ItemDesc
FROM MasterItemTable
WHERE (((MasterItemTable.ItemID) In (SELECT ExclusionTable.ItemID
FROM ExclusionTable;)));
 
Upvote 0

Forum statistics

Threads
1,221,877
Messages
6,162,583
Members
451,776
Latest member
bosvinn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top