MS Access Query Help

coucar3456

New Member
Joined
Jun 29, 2016
Messages
11
I have a query with field name COMPNOUN, is there a way, I can have all engines come back with number 1 and all transmission come back with number 7. Below is an example of some of the values listed in the field.

COMPNOUN
6.5 Engine
Transfer Case
Engine
5.7L Engine
Transmission
Radio
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Probably a UNION query, but your post doesn't make much sense because I can't evaluate your request against the data sample. That is, I see no "engine with number 1" or "transmission with number 7", although I do see a value that contains 7. If the data and problem described is far removed from what is actually going on, it sends us down the wrong path. I only mention this because I've been seeing more of this approach lately.
If you are not familiar with UNION queries, they are easy to learn how to create them. Gotta say though that if that's a memo field with all those values, or a multi-value field, or even just a sample of one field but with several records, you are in for a tough road ahead due to the design approach.
 
Last edited:
Upvote 0
This field in your Query could do the job:
NameToYourChoice: IIf([COMPNOUN] Like "*Engine*";1;IIf([COMPNOUN] Like "*Transmission*";7;0))
The result looks then like:
 
Upvote 0

Forum statistics

Threads
1,221,808
Messages
6,162,097
Members
451,741
Latest member
shove

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