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!
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: - SELECT *
-
FROM [Data Import]
-
LEFT JOIN [Cost Codes]
-
ON [Data Import].[Job Number] = [Cost Codes].JobNumber
-
AND [Data Import].[Cost Code] = [Cost Codes].CostCode
-
AND [Data Import].[Sub Job] & '' = [Cost Codes].SubJobNumber &''
I think the same thing can be accomplished with a couple NZ()s: - Nz([Data Import].[Sub Job], "") = Nz([Cost Codes].SubJobNumber, "")
Maybe you can tell us which works better. =)
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!
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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
|
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
|
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,...
|
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
| |
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
|
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.
|
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...
|
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
|
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
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |