Results 1 to 6 of 6
  1. #1
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    39

    Trying to Count Values in Query

    Hello All , Can anyonr tell me what I'm doing wrong here. I'm trying to count how many students based on the Criteria ( > = 12) from the age field.. In other words how many students are 12 and older ..
    Click image for larger version. 

Name:	Query.png 
Views:	13 
Size:	12.3 KB 
ID:	47260



    Click image for larger version. 

Name:	Q Design.png 
Views:	13 
Size:	18.4 KB 
ID:	47261

    Any help will me much appreciated .. Thank You

  2. #2
    MsAxes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Posts
    100
    If the age is a string, you might need >= "12" - what results are you getting when you run the query?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You have >= 12 on the count, not age.
    Last edited by June7; 02-13-2022 at 01:01 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Put the criteria into the first column?
    I believe you are trying to count more than 12 in the actual count?

    Showing the sql would confirm?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi
    It does look like you have set the joins between tables wrong.

    Also, I would suggest that the CheckIn field should be in the Attendance table.

    Can you upload the actual database?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    If the age is a string, you might need >= "12"
    IIRC, Access will automatically wrap criteria in quotes when it 'sees' that it is a text field. That's one way you'd know. Another is that in queries and tables, text is left aligned, numbers are right aligned. You can alter this in tables but not in query results.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-22-2018, 03:17 AM
  2. Replies: 7
    Last Post: 04-28-2014, 07:09 AM
  3. Replies: 3
    Last Post: 02-24-2014, 02:19 PM
  4. Can I count Null values in a totals query?
    By bgephart in forum Queries
    Replies: 2
    Last Post: 08-29-2012, 10:13 AM
  5. Replies: 2
    Last Post: 11-18-2009, 06:49 PM

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