dcsimg
Results 1 to 3 of 3

Thread: Count(*) does not work for null values

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2010
    Posts
    46

    Count(*) does not work for null values

    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 :

    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 by sifar786; Feb 15th, 2010 at 12:27 PM.

  2. #2
    New Member
    Join Date
    Feb 2010
    Posts
    1

    Re: Count(*) does not work for null values

    IF you can get it to work by creating a query in MS Access, you can then open that query in "SQL View" and it will spit it out for you. I don't know if Access has a count function though.

    Good luck

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2010
    Posts
    46

    Re: Count(*) does not work for null values

    I did not understand what you meant.

    Though i found a workaround for it:

    Code:
    SELECT COUNT(*)-1 AS Cntr
    FROM (Modul m LEFT OUTER JOIN
    Relation r ON m.Mod_Name = r.von)
    WHERE (m.[group] = '') or (m.[group] IS NULL)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width