473,587 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table Relationship with Blank Values

mjoachim
33 New Member
I am working on a query that'll find invalid entries. My users enter payroll data into a form and the form only allows them to enter active Cost Code & Job/Sub Job combinations, but often enough they change something after initial entry that results in an invalid combination.

In my query, I have a relationship created between my Data Import(Payroll entries) table and a table of current/active cost codes (see attached). With that relationship, I pull all entries from my Data Import table and only the Cost code field from the Cost Codes table if there is a match. This allows me to see if a match is missing and therefore invalid.

This works great if an entry has a sub job. The problem is if there is no sub job, that field in both tables is blank which doesn't appear to create a match for the relationship.

Is there some way to specify in the relationship that blank should match blank, or add a Nz( ,0) statement of sorts? I don't really want to store a 0 value in the tables, so am seeking out a way to create a match for comparison only.

Thanks!
Attached Images
File Type: jpg Table Relationship.jpg (44.6 KB, 186 views)
Dec 15 '16 #1
2 1255
jforbes
1,107 Recognized Expert Top Contributor
This won't be the most efficient Query, but it will probably do what you want:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM [Data Import] 
  3. LEFT JOIN [Cost Codes] 
  4. ON  [Data Import].[Job Number] = [Cost Codes].JobNumber
  5. AND [Data Import].[Cost Code] = [Cost Codes].CostCode
  6. AND [Data Import].[Sub Job] & '' = [Cost Codes].SubJobNumber &''
I think the same thing can be accomplished with a couple NZ()s:
Expand|Select|Wrap|Line Numbers
  1. Nz([Data Import].[Sub Job], "") = Nz([Cost Codes].SubJobNumber, "")
Maybe you can tell us which works better. =)
Dec 16 '16 #2
mjoachim
33 New Member
I would say they both work equally as well. Slow and inefficient as you expected, but nonetheless accomplishes what I asked.

As always, thank you for your help jforbes!
Dec 16 '16 #3

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

Similar topics

2
7484
by: Fons Roelandt | last post by:
Heelo, I have to Update all fields from a table with the values of a related table, i've tried some querys i found on the internet, but nothing seems to word, i even tried to lookup the value using dlookup, but even that doesnt seem to word in a update query. The query that i think should work is this one: UPDATE tblOrderLines AS tblO
3
1616
by: Mason | last post by:
I have a table consisting of people and their attributes. I would like to create a relationship matrix table that records the relationships between the people. So the two tables would look something like this: tblPeople *ID, AutoNumber LastName, Text FirstName, Text
0
1855
by: leavandor | last post by:
I am trying to design a query that works with a relationship between a Table and a Query. I am comparing a value in the table with a computed value inside the query. The reason for this is that the Query calculates a field to become identical to the corresponding table field, for instance: Table 1 contains field "ID", which is WV008A00 Table 2 contains field "ID In", which is WV001000
11
8633
by: Alan Silver | last post by:
Hello, I am using this validator on a textbox, and have discovered that if I set the InitialValue property, then the validator correctly fires if the user does not change the initial value of the textbox, but does NOT fire if the textbox is empty!! I thought the whole point of this validator was to ensure the control being validated had some text. Am I doing something stupid? It looks like I am going to need *two* validators for this,...
3
2872
by: MATTXtwo | last post by:
can people help me how to define table relationship i need some example to understand but make sure it's easy to understand coz my knowledge level still low in access
5
10207
by: titan.nyquist | last post by:
Is there a typical way to create a dictionary (or hash table) with two values, instead of one? Currently, my data structure is TWO dictionaries, each with matching and fully sychronized keys. This allows me to have one key with two values (one value in each dictionary). This is ugly code as the dictionaries could get out of synch (due to a bug or something). Titan
2
1198
by: genti1 | last post by:
Hi, I am kind of new with Access and I was wandering if someone could help me create a form where I can query data in a table by entering values in that form. For Example: I have a table called Customer. Customer fields are: (PK) CustomerID, CustomerName, CustomerAddr.
19
4737
by: billa856 | last post by:
Hi, I have to use the table(PRODUCTION) already generated in MS Access in which all fields are of TEXT type.fields like (orderdate,palletno,customercode,itemno,pono,carto n,pcs,totalquantity)Now i have already some data in table like 6000 rows.Now in that some fields are blank. Now I have created one Form in MS Access in which there are three ComboBoxes.1st one is independent,2nd one is dependent on 1st one and,3rd one is dependent on both...
1
2169
by: zoeb | last post by:
Currently I have a table, and would like the calculate a field in the table by referencing values from another 3 tables. i.e. tblData Index1, Index2, Index3, Value 1 2 3 2 2 2 1 3 4 and tblIndex1 Value Data 1 2.5
4
3104
by: PW | last post by:
Hi, I set up a relationship between two tables with the itineraryid fields in both tables: tblDailyItinerary tblDailyMeals I have a form that writes a record to tblDailyItinerary that updates the autonumber field itineraryid. I then bring up a subform which
0
8216
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
8349
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...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
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...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5719
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
3845
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
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
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.