Hi Nathan
By design, records containing Null in the field that is being counted are
not included in the Count, so this query will always return zero.
To count all records, whether or not they contain nulls, use an asterisk:
SELECT Count(*) AS NullDate FROM dbo_Feature
WHERE dbo_Feature.FeatureDateClosed Is Null;
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"Nathan" <(E-Mail Removed)> wrote in message
news:04380DBA-6839-406B-B1CD-(E-Mail Removed)...
>I have a table called dbo_Feature and column called FeatureDateClosed.
> I want to get a count of any records where the FeatureDateClosed column is
> null. I tried a simple count(FeatureDateClosed) query, with no luck. See
> below:
>
> SELECT Count(dbo_Feature.FeatureDateClosed) AS Expr1
> FROM dbo_Feature
> WHERE ((dbo_Feature.FeatureDateClosed) Is Null);
>
> This gives me zero. It should be about 1100. I vaguely recall that count
> isn't for null values, but don't remember the work around. Any help?
|