Contains "IF" statement

Mudbutt

Board Regular
Joined
Jul 18, 2011
Messages
158
I'm not sure what I'm doing wrong, hopefully someone can help me. In this field i have there are a few different variations of the "Stinger" (i.e. Stinger-Wet, Stinger-Dry, etc.). I'm trying to create a formula in access that just combines them both under one name, "Stinger". Yet, it's not working and returning my value.

IIf([qryPaintActuals]![Line]="*Stinger*","Stinger",[qryPaintActuals]![Line])


This isn't working, it just returns the original ones instead of combing them to "Stinger".
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Change the = sign to LIKE (you're doing a wildcard comparison, not an exact match, and that matters to a database). So...

IIf([qryPaintActuals]![Line] LIKE "*Stinger*","Stinger",[qryPaintActuals]![Line])

Denis
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

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