I am using the following for a duplicate query that seems to be failing when the [unitnr] is null.
I am a novice programmer, and have only written this database to help out a local charity organisation organise delivery of Christmas hampers, so speedy resolution would be much appreciated.
My SQL code is as follows:
SELECT tblContacts.HouseNr, tblContacts.StreetName, tblContacts.UnitNr, tblContacts.ContactID, tblContacts.FirstName, tblContacts.LastName
FROM tblContacts
WHERE (((tblContacts.HouseNr) In (SELECT [HouseNr] FROM [tblContacts] As Tmp GROUP BY [HouseNr],[StreetName],[UnitNr] HAVING Count(*)>1 And [StreetName] = [tblContacts].[StreetName] And [UnitNr] = [tblContacts].[UnitNr])))
ORDER BY tblContacts.HouseNr, tblContacts.StreetName, tblContacts.UnitNr;
Used the Duplicate Query Wizard to arrive at this code.
Many thanks in advance, Phil
I am a novice programmer, and have only written this database to help out a local charity organisation organise delivery of Christmas hampers, so speedy resolution would be much appreciated.
My SQL code is as follows:
SELECT tblContacts.HouseNr, tblContacts.StreetName, tblContacts.UnitNr, tblContacts.ContactID, tblContacts.FirstName, tblContacts.LastName
FROM tblContacts
WHERE (((tblContacts.HouseNr) In (SELECT [HouseNr] FROM [tblContacts] As Tmp GROUP BY [HouseNr],[StreetName],[UnitNr] HAVING Count(*)>1 And [StreetName] = [tblContacts].[StreetName] And [UnitNr] = [tblContacts].[UnitNr])))
ORDER BY tblContacts.HouseNr, tblContacts.StreetName, tblContacts.UnitNr;
Used the Duplicate Query Wizard to arrive at this code.
Many thanks in advance, Phil