473,503 Members | 1,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Query Criteria - working with a Domain "\" user list.

MitchR
65 New Member
Howdy Folks!

I am working on a project where I have been given Domain\Usernames (Contoso\JSmith) and my data dump has records containing the Domain\ and no user name, Domain\administrator, and Bogus Domains that I need to remove with delete queries. I am looking to isolate both the left and right of the "\" to remove garbage items, but I need some assistance in doing so. I have attempted to use the following:
Expand|Select|Wrap|Line Numbers
  1. Right([tbl_users].[user_list_Column],InStr([tbl_users].[user_list_Column],'\'))>"" 
Expand|Select|Wrap|Line Numbers
  1. Left([US_Local_Admin],InStr([US_Local_Admin],'\')-1) <>"Contoso"
I know I am going nowhere fast and need some assistance.
Jan 27 '21 #1
3 1738
NeoPa
32,557 Recognized Expert Moderator MVP
Hi Mitch.

It can be done all in one go but it's easier to define two (calculated) Fields first then reference them in your logic :
Expand|Select|Wrap|Line Numbers
  1. Domain: IIf([tbl_users].[user_list_Column] Is Null,Null,Left([tbl_users].[user_list_Column],InStr([tbl_users].[user_list_Column],'\')-1))
  2. UserName: IIf([tbl_users].[user_list_Column] Is Null,Null,Mid([tbl_users].[user_list_Column],InStr([tbl_users].[user_list_Column],'\')+1,999))
  3. Check: ([Domain]<>'Contoso')
Etc.
Jan 28 '21 #2
MitchR
65 New Member
Thank you so much! I really appreciate your insight, and you are so right!
Jan 29 '21 #3
NeoPa
32,557 Recognized Expert Moderator MVP
Always a pleasure :-)
Jan 30 '21 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1579
by: jen | last post by:
What is the correct syntax to reference a form field in a query. For example, I want to pull data where field x of my table equals field y on a form? Thanks in advance for the help!
2
1665
by: mgolding | last post by:
I have an Access query that gets an ID value from an open form. Something like SELECT * from tablename WHERE ID=openFormName.ID; But now, I want to also run the query by handing it the ID from...
3
1501
by: PCCTN | last post by:
I am trying to find out what criteria to put into a specific query that is connnected to a table field of part numbers. The problem is that it has some part numbers that are numbers and some part...
3
1681
by: heckstein | last post by:
I have created a query in MS Access 2003 that is pulling training records for our company that includes training hour calculation. One field I am pulling is the instructor name. Many courses have...
3
3316
by: marylipscomb | last post by:
I am going over code that I am now responsible for but did not write. Can someone tell me what this means? Thank you so much Also this is on a query, criteria. Like "*" & !! & "*" What does...
2
2322
by: Aussie Rules | last post by:
Hi, I have a access 2007 database with a cross tab query. Based on the selection critieria the cross tab may contain a different number columns in the result. For example if the query is...
9
18076
ajhayes
by: ajhayes | last post by:
Hello everyone, This is my first time posting here and I'm hoping someone can help me out. I'm a relative newbie to Access and am pretty much learning as I go along, so please bear with me. ...
5
3664
by: erog | last post by:
Hello I've tried using the MS Access Northwind sample DB and I've downloaded a few other sample Microsoft Access DBs from their website. I keep on running into the same problem for trying to...
1
1409
by: JMacdonald | last post by:
I have a datasheet with a column called 'Primary Category' which has a drop-down menu so the user can select from a number of different categories. I am trying to create a query which uses one...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.