473,652 Members | 3,162 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\Username s (Contoso\JSmith ) and my data dump has records containing the Domain\ and no user name, Domain\administ rator, 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 1747
NeoPa
32,568 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,568 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
1592
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
1675
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 a report. How do I set the Criteria for a query so it can take the ID value from either the form or the report (or any source I call the query from)?
3
1516
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 numbers that are letters. For example: "16579" or "CAN123456" I want it to only include the ones with out the "CAN" and only show the numbers. I am using the query for a report and do not want to show the part numbers starting with "CAN" because...
3
1685
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 multiple instructors, which means I am getting multiple records for a single course. I need to capture all of the instructor names, but I only want a single record for each course due to the hour calculation. I would like the report to generate only one...
3
3327
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 ! mean in this and the & sign mean in this..
2
2329
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 'select * from crosstab where project =1' would retun 6 columns, but if I change the query to project =2 then the result would be 20 columns. In my VB2008.net application I create the sql select statement. The problem
9
18100
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. Here is what I am trying to do. I'm building a simple database that will allow our engineering staff to enter in the items from the inventory warehouse that will be required for a project. Each inventory item has a unique part number, which is...
5
3683
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 retrieve user input from a query form. In the Northwind DB, there is a query named "Invoices Filter". In the criteria for the OrderID field in the Invoices table, the following is entered: !! I understand that for this field, it's trying to...
1
1420
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 category (ex. trust) from the drop down menu as criteria. When I simply type in the category "Trust" and run the report it won't display any records. It works properly when I use Is Null as the criteria. Any ideas on how I can fix this?
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.