Query Filter

juneau730

Board Regular
Joined
Jun 7, 2018
Messages
111
I have a field in my dBase that contains the Active Directory Distinguished Name, that I need to filter on to separate account types. The data string in the field will look like this for a user account:

CN=Lapp\, Lawrence E. (Larry) (TUC) ISSO,OU=Users,OU=Tucson (TUC),OU=VISN18,DC=v18,DC=med,DC=va,DC=gov

And this for a service account:

CN=Admin\, Dental,OU=Service Accounts,OU=Tucson (TUC),OU=VISN18,DC=v18,DC=med,DC=va,DC=gov

I need to filter on either the word User or Service (bolded) so I can pull the different account type to their respective tabs. I have tried a like filter with a wild card parameter and that didn't work.

Any assistance would be great.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I don't use Access really. So not sure if the wild card character is % or *

How about,

WHERE fieldname LIKE '%,OU=Users,%' OR fieldname LIKE '%,OU=Service Accounts,%'

and obviously if *
WHERE fieldname LIKE '*,OU=Users,*' OR fieldname LIKE '*,OU=Service Accounts,*'
 
Upvote 0
Good morning, thank you for the suggestion. After trying both strings you provided, unfortunately neither of them worked.
 
Upvote 0
How exactly did you implement the use of this search criteria? (i.e., if in SQL, then what is the actual SQL that you used?)
 
Upvote 0
Score! I was able to get it working..

If I add the criteria filter in design view vice SQL view, the string would look like

Like "*Users*"

where the * is wildcards before and after the key word
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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