Results 1 to 7 of 7
  1. #1
    mbaptista1970 is offline Novice
    Windows Vista Access 2000
    Join Date
    Jan 2011
    Posts
    4

    Post Access function to count records

    Hello,

    I am attempting to count records within a data base that do not match one possibel answer in a given field.
    To put it more clearly, I want to count the companies in a database that are headquartered in several several countries except one, Portugal. What is the Access function formula that will deliver that answer?
    Data base: Member Companies
    Table: Companies data
    Field: Headquarter
    Best regards,

    Manuel Baptista

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Depending on how/where you want the answer, you can use SQL or a DCount() function, with the appropriate criteria (Headquarter <> "Portugal").
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mbaptista1970 is offline Novice
    Windows Vista Access 2000
    Join Date
    Jan 2011
    Posts
    4

    Post Access function to count records - exclusion of 2 or more answers

    Dear Mr. Paul Baldy,

    Thank you so much for your answer. It solved me a problem that I have been trying to fix for several months!
    There is just one more thing I would like to ask you: to count records that do not match more than 1 possible answer in a given field - using my former example, let's say I want to exclude 2 countries, Portugal and Spain - how can I use the function Dcount the way you told me and separate these two answers? I have tried using a comma (Headquarter <> "Portugal", repeating the symbols <>, leaving blank spaces but none worked out.
    Regards,

    Manuel
    Lisbon, Portugal


    Quote Originally Posted by pbaldy View Post
    Depending on how/where you want the answer, you can use SQL or a DCount() function, with the appropriate criteria (Headquarter <> "Portugal").

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You probably didn't repeat the field name. Try

    Headquarter <> "Portugal" AND Headquarter <> "Spain"

    In SQL you could also use

    ...WHERE Headquarter NOT IN("Portugal", "Spain")

    Say hello to my friend Estuardo who also lives in Portugal.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    mbaptista1970 is offline Novice
    Windows Vista Access 2000
    Join Date
    Jan 2011
    Posts
    4

    Smile Access function to count records -

    Dear Mr. Paul Baldy,

    Thank you so much for your 2 answers regarding the MS Access "DCount" function.
    Both were totally useful and solved me 2 problems that I had been trying to fix for several months!
    You really have an extensive knowledge of the programme.
    Best wishes,

    Manuel Baptista
    Lisbon, Portugal
    (mbaptista1970@gmail.com)

  6. #6
    mbaptista1970 is offline Novice
    Windows Vista Access 2000
    Join Date
    Jan 2011
    Posts
    4

    Smile Access function to count records - problems solved

    Dear Mr. Paul Baldy,

    Thank you so much for your 2 answers regarding the MS Access "Dcount" function.
    Both were totally useful and made me solve 2 problems I had been trying to fix for several months!
    You really have an extensive knowledge of the programme.
    Best wishes,

    Manuel Baptista
    Lisbon, Portugal
    (mbaptista1970@gmail.com)

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help Manuel; good luck with the project.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Count Records
    By Cheshire101 in forum Access
    Replies: 1
    Last Post: 11-30-2010, 03:02 PM
  2. Is it possible for me to count my records? how?
    By radicrains in forum Queries
    Replies: 4
    Last Post: 10-28-2010, 05:28 AM
  3. Count function on query
    By yousillygoose in forum Queries
    Replies: 1
    Last Post: 02-15-2010, 09:58 PM
  4. Count function in Query always Read Only?
    By terbs in forum Queries
    Replies: 3
    Last Post: 01-19-2010, 05:43 PM
  5. Query using count function
    By wasim_sono in forum Queries
    Replies: 0
    Last Post: 11-28-2007, 03:16 AM

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
  •  
Other Forums: Microsoft Office Forums