Access Count Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alritedonthaveacow
    New Member
    • Jul 2007
    • 4

    #1

    Access Count Problem

    Hi,
    i am creating a database for my dads business and i have one problem with one bit. its pretty basic
    i have a query that is counting records in column A But it want It not to include records witch have Sold or Used in column B.

    please can someone help. its the very last thing i need to complete in my database and its driving me mad
    thanks
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

    MODERATOR.

    PS I've changed it to something more appropriate.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      Originally posted by alritedonthavea cow
      Hi,
      i am creating a database for my dads business and i have one problem with one bit. its pretty basic
      i have a query that is counting records in column A But it want It not to include records witch have Sold or Used in column B.

      please can someone help. its the very last thing i need to complete in my database and its driving me mad
      thanks
      As for your question, you can do that without too much trouble, but how it is best done depends on exactly what you need. Post in the SQL of your current query and I'll look into it for you.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Open the graphical query editor and place column B
        In the Criteria cell below enter:

        NOT IN ('used';'sold')

        This will exclude the values.

        Nic;o)

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          This is one of the solutions. This assumes that you only want to include those records from the query. If, however, you want to count those records but include the whole dataset for another field (for instance) then you need to use a construct (in the SQL) like :
          Code:
          SELECT ...
                 IIf([ColumnB] In('Used','Sold'),1,0) AS CountUsedSold,
                 ...
          FROM [Table]
          ...

          Comment

          Working...