Results 1 to 9 of 9
  1. #1
    Eoluke is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    6

    Count in report

    Hello, I have a query that has a calculated field for "Current Age". I would like to create a report that simply will count the number of people within certain age brackets. Ex: 21-30, 31-40, 41-50 etc. It seems like there should be a simple solution to this but as a total noobe, it escapes me. Any ideas out there? Thank you so much in advance.

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,413
    have a look at the partition function for sql

    https://support.office.com/en-us/art...7-c94278274dc5

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Calculate an age group field in query or in report design. Use that constructed field to group and count records.

    Switch([Current Age]<=30,"21-30", [Current Age]<=40, "31-40", [Current Age]<=50, "41-50", True,"Over 50")

    EDIT: or use Ajax's suggestion for Partition function.
    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
    Eoluke is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    6
    Both interesting however I have no idea where to start or put these. I guess it isn't as easy as i thought.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You do this in the Field row of a query. Basic Access functionality. You should probably complete some tutorials. Start with http://www.rogersaccesslibrary.com/
    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.

  6. #6
    Eoluke is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    6
    Ok, I made a calculated field using "switch". I also made a simple report and grouped by this field. It works wonderfully. The report has a total count in the report footer. Is there a way to separate that count by the age groups?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Do a calc in the GROUP header or footer section.
    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.

  8. #8
    Eoluke is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    6
    Using "Count" in a text box and can't get the syntax right but will keep trying. Thanks for all your help.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Syntax is same as the calc in report footer:

    =Count(*)
    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.

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

Similar Threads

  1. Replies: 3
    Last Post: 01-13-2016, 12:34 PM
  2. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  3. =Count in SQL Report
    By Brian62 in forum SQL Server
    Replies: 17
    Last Post: 06-19-2012, 05:15 PM
  4. count & sum in report
    By ali zaib in forum Access
    Replies: 1
    Last Post: 01-16-2012, 02:35 PM
  5. Count and Sum in Report
    By Brian62 in forum Reports
    Replies: 3
    Last Post: 02-19-2010, 04:10 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