Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Finding null-values

Author  Topic 

dzsondzsi
Starting Member

3 Posts

Posted - 2009-08-04 : 11:14:37
I have two tables to compare.
How can I find those records which contain a null-value in one table and something else in the other?


The SQL-statement at the moment is:

SELECT [Vendors ECC].[Vendor Num], [Vendors ECC].[Name 2], [General Data MDM].[Name 2]
FROM [Vendors ECC] INNER JOIN [General Data MDM] ON [Vendors ECC].[Vendor Num] = [General Data MDM].[Vendor Number]
GROUP BY [Vendors ECC].[Vendor Num], [Vendors ECC].[Name 2], [General Data MDM].[Name 2]
HAVING ((([General Data MDM].[Name 2])<>[Vendors ECC]![Name 2])) OR ((Not ([Vendors ECC].[Name 2])=IsNull([Vendors ECC]![Name 2])) AND (([General Data MDM].[Name 2])=IsNull([General Data MDM]![Name 2]))) OR ((([Vendors ECC].[Name 2])=IsNull([Vendors ECC]![Name 2])) AND (Not ([General Data MDM].[Name 2])=IsNull([General Data MDM]![Name 2])));

However, it does return only those where there are not null-values in both fields.

dzsondzsi
Starting Member

3 Posts

Posted - 2009-08-04 : 12:02:23
Solved already.
Go to Top of Page
   

- Advertisement -