473,473 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Comparing Tables Containing null Values

We have a query which compares each field in two tables (let's say
Table1 and Table2) and identifies any records that have been modified.
For example, one of these columns looks like:

Field: Priority
Table: Table2
Sort:
Show:
Criteria: <>[Table1].[Priority]

However, if Priority in Table1 has a value, and Priority in Table2 is
null, the query doesn't identify this as a mismatch. Using NZ works,
but is this the proper way to compare fields?

Field: Expr1: nz([Table2].[Priority])
Table:
Sort:
Show:
Criteria: <>nz([Table1].[Priority])

May 10 '06 #1
2 3076
It's either that, or add in "or table1.priority is null or table2.priority
is null" stuff.

As long as you use some value in Nz that's not a match for any actual data,
that should work just fine. You can specify with Nz what value to use, if
the data is null; you don't have to stick with the defaults of 0 for numeric
or "" for text.

Anne

"Wayne" <go******@comcast.net> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
We have a query which compares each field in two tables (let's say
Table1 and Table2) and identifies any records that have been modified.
For example, one of these columns looks like:

Field: Priority
Table: Table2
Sort:
Show:
Criteria: <>[Table1].[Priority]

However, if Priority in Table1 has a value, and Priority in Table2 is
null, the query doesn't identify this as a mismatch. Using NZ works,
but is this the proper way to compare fields?

Field: Expr1: nz([Table2].[Priority])
Table:
Sort:
Show:
Criteria: <>nz([Table1].[Priority])

May 10 '06 #2
Thanks for the confirmation Anne.

May 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jeff brubaker | last post by:
Hello, Currently we have a database, and it is our desire for it to be able to store millions of records. The data in the table can be divided up by client, and it stores nothing but about 7...
3
by: twdo | last post by:
Let me see if I can explain my situation clearly. I have a table with the columns: answer_id, question_id, member_id, answer - answer_id is the primary key for the table. - question_id...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
0
by: Jeff Marcum | last post by:
I have two tables that I want to compare and show me the unmatched records. I want to use all fields on both table in the comparison. Here is an example of the fields that are on both tables. ...
0
by: laxmiuk | last post by:
I've original version of a table called PMM (Product Material Master). Thro' a web interface, user can change that table contents. Once changed, i need to raise an ECN (Engineering CHange Note)...
5
by: Frank | last post by:
Hello All, I am working on a vb.net app where I need to compare to 2 datatables and determine if a string exists in one or both. The first dt is filled from the db. A form is loaded and the...
19
by: Ole Nielsby | last post by:
How does the GetHashCode() of an array object behave? Does it combine the GetHashCode() of its elements, or does it create a sync block for the object? I want to use readonly arrays as...
4
by: gillianbrooks91 | last post by:
Forgive me for asking this question, I've trawled through nearly every available post on this subject that I can find for a few weeks now but nothing quite points me in the right direction. I'm...
11
by: jennifersalcido | last post by:
Hello All, I am working with two tables that contain inventory data: 1) INVENTORY contains item_number, description, etc. This data is relatively straight-forward, one record per item_number....
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.