Null Values, NZ Query Help!!

echorley

Registered User.
Local time
Today, 01:36
Joined
Mar 11, 2003
Messages
131
When I query a column in a table for a specific word (I want to COUNT how many times the word is in the list) and that word is not in the list, how do I get the query to return a value of zero instead of a null value?

I am sure that NZ (or Iif) must be part of this and written in SQL, but I am not sure where to include it in the query or how.

Thanks!
 
Count does not return null, either zero or a count.

SELECT COUNT(1) from MyTable where CheckCol like "Tuff*"

would not match. but will return zero or a count
 
Excellent!

I have no clue what the "(1)" in Count(1) does or means, but the SQL now works great!

Thanks.
 
It means count 1 each time.
In SQL you can use almost anything, Count(2) gives the same results as Count(1) or Count(*). Some people find the count(1) more readable than others.
 

Users who are viewing this thread

Back
Top Bottom