Query null question

  • Thread starter Thread starter ryan.fitzpatrick3
  • Start date Start date
R

ryan.fitzpatrick3

I have a query that has a field that for some records it's blank while
others it has information. Is there away to pull the records that have
information in it so for example:

1
2
3 Ryan
4
5
6 Tom
7 Ryan

If I wanted to pull the records that have names in it it'll only pull
records 3, 6 and 7

Also, is there away to look for duplicate entries such as Ryan it'll
pull records 3 and 7? Thanks

Ryan
 
Is there away to pull the records that have information
If you use a criteria on a field then only the records meeting it will be
pulled. Criteria of Like "*" will not pull null records.
SELECT Field1
FROM YourTable
WHERE Count([Field1])>1
GROUP BY Field1;
 
Hi Ryan

To eliminate Nulls, use a WHERE clause with "is not null"

Select * from [YourTable] where [NameField] is not null;

To find all the records with duplicates, you can use the "Find Duplicates
Query Wizard" or you can build it yourself:

SELECT *
FROM [YourTable]
WHERE [DupField] In (SELECT [DupField] FROM [YourTable] As Tmp
GROUP BY [DupField] HAVING Count(*)>1)
ORDER BY [DupField];

BTW, I've replied to your followup questions on the other thread.
 
Thank you. Now if I wanted to look for Nulls only how would that go?


If you use a criteria on a field then only the records meeting it will be
pulled. Criteria of Like "*" will not pull null records.

SELECT Field1
FROM YourTable
WHERE Count([Field1])>1
GROUP BY Field1;
--
KARL DEWEY
Build a little - Test a little

I have a query that has a field that for some records it's blank while
others it has information. Is there away to pull the records that have
information in it so for example:
1
2
3 Ryan
4
5
6 Tom
7 Ryan
If I wanted to pull the records that have names in it it'll only pull
records 3, 6 and 7
Also, is there away to look for duplicate entries such as Ryan it'll
pull records 3 and 7? Thanks
 
Back
Top