Results 1 to 4 of 4
  1. #1
    tatihulot is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    100

    Filtering Data to Show a Specific Number of Records per Field?

    Hello, may I please request a bit of assistance with creating a query?

    What I want to do with my music collection database is create a tally of how many albums are connected to each artist.

    I want to display the list so I see only the artists with 14 or more albums.

    For example, in my database, the Beatles have 15 albums, Bruce Springsteen has 20, AC/DC has 18, and the Ramones and Bob Dylan both have 16.



    Steely Dan and Pavlov’s Dog have less than 14, so I would not want them to appear in the list.

    So, I’d want the list results to look something like this:
    Artist Title Count
    AC/DC 18
    Beatles 15
    Bob Dylan 16
    Bruce Springsteen 20
    Ramones 16


    This is all I really want the query to do.

    Is this possible, and if so, what’s the best way to do this? Will SQL be the best way to approach this?
    Thank you.

    music_current.zip

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Depends on your DB setup?
    Do you have a table for Artists and a table for Abums ?

    Or do you just have one table setup like an Excel spreadsheet?
    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

  3. #3
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    Create a totals query

    I renamed the Music table to Artist.

    SELECT Artist.Artist, Count(AlbumTitle.AlbumTitlePK) AS CountOfAlbumTitlePK
    FROM Artist INNER JOIN AlbumTitle ON Artist.MusicPK = AlbumTitle.ArtistFK
    GROUP BY Artist.Artist
    HAVING (((Count(AlbumTitle.AlbumTitlePK))>15));

  4. #4
    tatihulot is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    100
    After doing some further research, I found out how to do this. Thank you for the replies.

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

Similar Threads

  1. Replies: 8
    Last Post: 08-08-2024, 10:32 AM
  2. Replies: 6
    Last Post: 02-10-2017, 08:21 AM
  3. Replies: 1
    Last Post: 02-24-2015, 06:54 PM
  4. Replies: 5
    Last Post: 05-22-2013, 12:38 PM
  5. Replies: 0
    Last Post: 01-03-2011, 03:38 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