Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting up a report table

    I have the need to show a report where I can see what music has been played on a given day.

    something like:

    .....................Date....................
    Number | name | artist | time | hits
    Number | name | artist | time | hits
    Number | name | artist | time | hits
    .....................Date....................
    Number | name | artist | time | hits
    Number | name | artist | time | hits
    Number | name | artist | time | hits
    .....................Date....................
    Number | name | artist | time | hits
    Number | name | artist | time | hits
    Number | name | artist | time | hits

    Noting that "name" could be on more than one date.
    How can I best go about setting up the output?
    I realize I may have to have a second table based upon date.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,719
    Thanks
    25
    Thanked 662 Times in 661 Posts
    Some thing like this:
    .......Date.........
    name | artist | hits

    SELECT song_titles.name, song_titles.artist, COUNT(playlist.number)
    FROM song_titles, playlist
    WHERE song_titles.number = playlist.number
    AND `playlist.date` = THE DAY YOU WANT OR THE SPAN OF DATES
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks sunfighter. I'll see if that works.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •