Results 1 to 6 of 6
  1. #1
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50

    Count in a Query

    Hello,



    I have a query written and I am using the count function to count the number of items performed or requested. However, when I use the Not Like criteria when counting, it appears that access ignores this command and counts the 'not like' item in the total. Is there a way around this or do I need to figure out a different way to obtain my count query?

    Bentley

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    If you're using <> This OR <> That
    try
    <> This AND <> That

  3. #3
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50
    I ended up adding an additional field to fix the issue. Now I have another in the same query. How do I count one item from a combo box where I made the choices? I have entered in the criteria using the "like" & "not like" but neither seems to work.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    suggest you post the entire sql for your query so we can see what we are dealing with

  5. #5
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50
    I am not sure how to post the SQL to this thread.

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    if you are talking about query sql open the query in design view

    select the sql window (from dropdown to the left of the ribbon, or the SQL button to the bottom right of the access window)

    copy the code and paste into your post, then highlight the pasted code and click on the code button (# button) to surround the code with the code tags

    if talking about vba code

    highlight the relevant code (the whole function or sub) copy, paste and surround with code tags as above

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

Similar Threads

  1. Replies: 2
    Last Post: 06-30-2016, 06:38 PM
  2. Year Count and Month Count Same Query
    By NateSmith in forum Queries
    Replies: 1
    Last Post: 05-13-2015, 08:23 AM
  3. Replies: 2
    Last Post: 04-15-2014, 01:59 PM
  4. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  5. Replies: 7
    Last Post: 05-02-2012, 08:04 AM

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