pretty new to sql in general, I have to identify 52 "empty" entries in our db to see which contacts they are connected to, if any, and have been unable to isolate them so far. We are using mssql 7.0 on a windows 2000 vm.
What i mean by "empty" entries is that when a user opens the db application to search for contacts, which are listed in alphabetical order, the first 52 contacts are simply all blank. You can scroll through them one by one, but there is no information attached to them.
I have tried simple select statements, but have been unsuccesful in isolating the entries.
Here are a few examples of the select statements I've tried:
Ex.1
SELECT DISTINCT Kon_NachN, Kon_VorN, Kon_ID
FROM tbl_Kontakte
WHERE Kon_Fa='' AND Kon_NachN ='' AND Kon_VorN =''
Delivers 159 rows
Ex.2
SELECT DISTINCT Kon_ID, Kon_Fa, Kon_VorN, Kon_NachN
FROM tbl_Kontakte
WHERE Kon_Fa is NULL AND Kon_VorN is NULL AND Kon_NachN is NULL
ORDER BY Kon_ID ASC
Delivers 0 rows
Ex.3
I noticed when i selected all Kon_ID that certain numbers were missing and tried to isolate those, but was unsuccessful with the 2 statements below
SELECT *
FROM tbl_Kontakte
ORDER BY Kon_ID ASC
Missing Kon_ID are for example 3, 12, 17, 33,87,88,96,97
SELECT *
FROM tbl_Kontakte
WHERE Kon_ID ='3' OR Kon_ID ='12' OR Kon_ID ='17'
ORDER BY Kon_ID ASC
Delivers 0 rows
These entries are definitely not there, but i couldnt figure out how to find any attached info, but i figured with 8 missing Kon_IDs in the first 100 entries in a db with over 4000 entries that i must be off the mark.
Ex.4
SELECT *
FROM tbl_Kontakte
WHERE (Kon_VorN is null or Kon_VorN='') and (Kon_NachN is null or Kon_NachN='')
ORDER BY Kon_ID ASC
Delivers 3359 rows
Since this is pretty much my first crack at SQL outside of online tutorials (also first time posting here), i guess i figured i would find 52 results matching the number of "empty" entries and be able to go from there fixing each entry to show the appropriate information. Sorry if this is all unclear or has an obvious solution, but i thought i would see if anyone had any ideas.Thanks.