Question Count(*) does not work for null values

sifar786

Member
Joined
Feb 14, 2010
Messages
5
Programming Experience
3-5
hi,

i m trying to run a query on an MSAccess table, but it does not give me any count but only 0.

There are 3 null values which i should be getting but it does not give me the result. This query works perfectly in MSSql Server 2008.

the query is :

VB.NET:
SELECT        COUNT(*) AS Cntr
FROM            (Modul m LEFT OUTER JOIN
                         Relation r ON m.Mod_Name = r.von)
WHERE        (m.[group] = '')

I need a workaround for this but am unable to find one. Any help would be most appreciated.
 
Last edited:
is m.[group] the field that is null? If so your where clause needs to be
VB.NET:
WHERE m.[group] IS NULL

a NULL value is not the same as an empty string(field='')
 
Since you are doing a join its probably because there are multiple rows in the Relation table with the same id.
 
Back
Top