Quick question on Query

huntersoasis

New Member
Joined
Jun 9, 2015
Messages
7
I have a table that has a Item + Multiple category fields

(Item Number) + (Item Name) + (Category1) + (Category2) + (Category3) + (Category4) + (Category5) + (Category6) + (Category7)


The issue I am having is if im looking for Category "Long" or "Short" This word will show up once if its part of the item but it could be in any of the 7 fields....

I need a qurey that pulls up all that have "Long" in any of the 7 Category fields

If i call its "Long" in the first one and the other 6 nothing displays if I do "Long" in the first and "long" in the Or of the rest it doesnt display them

How can i get it to dispaly the Item anytime there is "Long" in any of the Category fields?

Thanks,
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What you have is a problem caused by poor design. There should not be "nothing" in a bunch of fields (and preferably not in any)I suggest you Google 'datatbase normalization' or variations of that and see if it convinces you to change any table design. You should have 1 table with itemNum and itemName and 1 table for category with a common field of the same data type between them. I can't say too much about how this one should look because Category1, Category2 doesn't tell me much. A guess would be CatID, CatName, CatDesc and CatIdD, but I can't really guess on how they relate to Item. While you're at it, check out how to name tables, fields, controls, etc. so you avoid common pitfalls such as using reserved words (like Name) as well as spaces & special characters.

Otherwise, you will need each field in your query design grid, and in each field, type "Long" as the criteria, but not on the same row. So you will have seven rows of criteria for these fields (looking like a staircase), plus if you need an item value as criteria, you will have to put that in each row of that(those) field(s) Methinks that since this is an Excel forum, I should suggest that you forget most of what you know about spreadsheet layout when it comes to designing a database. Hope this helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,860
Messages
6,162,479
Members
451,769
Latest member
adyapratama

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