Results 1 to 8 of 8
  1. #1
    David Reading is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    4

    Query Filtering Problem

    Working on my first Access 2013 Database. I am creating a simple query that filters. It works fine. I now would like to SUM the number of records that I am filtering, but I am struggling with the syntax.



    Thanks for any help that I can get. In the fourth column I would like to SUM just the Day Type of "Used".


    Click image for larger version. 

Name:	Query2.jpg 
Views:	5 
Size:	61.6 KB 
ID:	30362
    Last edited by David Reading; 09-19-2017 at 10:26 AM. Reason: Add Picture

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    in the footer of the form, put a text box and set the sum:
    =sum(field)

    filtered or unfiltered you will get the sum.

  3. #3
    David Reading is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    4
    I am not working with a form, I am trying to filter a query.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If "Day Type" is a word like "Used", what exactly are you summing?
    Do you mean "Count"?

    I think you want to put "Used" in the Criteria field, and if you want to Count, pick any field to count on.

  5. #5
    David Reading is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    4
    JoeM - Absolutely correct, on the Count vs. Sum. Not sure what I was thinking. However, I think I have erred in the creation of my database, because when I put the Criteria "Used", I get a "Data type mismatch in criteria expression" error. Without criteria, it runs fine.

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Which field are you putting the Criteria under?
    It needs to be under the field that has "Used" as its value for some records.

  7. #7
    David Reading is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2017
    Posts
    4
    JoeM - The error was in the data type in the table. I'm working to fix it. Thanks for your help!

  8. #8
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome.

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

Similar Threads

  1. Replies: 0
    Last Post: 03-02-2015, 06:38 PM
  2. Problem Filtering table in a sub-form
    By Xarkath in forum Access
    Replies: 6
    Last Post: 09-17-2014, 02:42 PM
  3. Filtering by date field problem
    By yzksn in forum Programming
    Replies: 1
    Last Post: 04-19-2012, 01:59 PM
  4. Date Filtering problem
    By TubbyGrey in forum Access
    Replies: 6
    Last Post: 10-22-2010, 10:46 PM
  5. Problem filtering a report
    By mrk68 in forum Reports
    Replies: 1
    Last Post: 05-03-2009, 09:31 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