Can I make a table of entries and run a query off of it?

R

ryan.fitzpatrick3

I have a lot of item #'s to look up, like 50, so I put them in a
table, I also listed some key's so certain items could be lumped up
together easily. It looks like this

autonum item class group
1 123456 RETAIL OIL
2 123457 RETAIL OIL
3 123458 RETAIL SUGAR
4 123459 RETAIL SUGAR
5 122001 SUPPLY OIL
6 122021 SUPPLY OIL
7 122456 SUPPLY COCOA
ETC


This is how my table is laid out, I can link "ITEM" to the item number
in our database we use since the item numbers match. In my query under
itemnumber criteria, I normally would enter in the item numbers and
when I run the query it would run really quick, but when I link the
table up to pull all of the numbers in the table (listed above) it
takes forever and many times I will have to force quit out of it. What
should I be doing? In the database I access the "item number" is text
and I made my table "item number" text as well. Any help?

Ryan
 
K

Klatuu

If what you are trying to do is to return the record in the main table that
match the items in the entry table (the table you describe), what you need is
a sub query. It will look something like this:
SELECT * FROM MainTable WHERE item IN (SELECT item FROM EntryTable);
 

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

Top