Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002

    Red face Unanswered: Counting Records

    I have set up a query using the tables article and user.
    I am grouping by user.[user_id] and counting the number of records from the article table related to that useras Articles.

    It works, but if a user has no records related to them their user ID does not show up in the datasheet with a zero under Articles.
    I simply want it to display ALL user_id's even if the count of fields in table 'article' relating to that user is zero.

    Can anyone help please?

  2. #2
    Join Date
    Oct 2001
    SELECT User.User_ID, Count(Article.ArticleID) AS CountOfArticleID
    FROM Article RIGHT JOIN [User] ON Article.User_ID = User.User_ID
    GROUP BY User.User_ID;


  3. #3
    Join Date
    Oct 2002
    Ahh, Thanks a lot.
    I didnt fully understand join types till I had a look over the 'evil access help systen' and realised I was expecting a record to show up that wasn't even in my database.
    So it works. Just didn't realise until I further persued my imaginary problem.
    Thanks again. (should have known a forum would be the first place to ask, could have saved me hours)

Posting Permissions

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