1) How many times the current song has been played in a given time period
2) How many total plays of ANY song have been played in the same period, and
3) How many different songs have been played in this period.
For example, if I had played a 15-song playlist three times, I would find that the current song has been played 3 times, and there have been a total of 45 plays, and 15 unique songs have been played during this time.
The following snippet of code from AutoRateSongs tells us how many times a song has been played in a given time:
Code: Select all
StrQuery = "SELECT Count(Played.IdSong) AS arNoP "_ + "FROM Played "_ + "WHERE (((DateDiff(" & D_H & ",Now(),[Played].[Playdate])>=-" & CB_A & ")=True)) "_ + "GROUP BY Played.IdSong "_ + "HAVING Count(Played.IdSong) >0 AND Played.IdSong=" & arSongID Dim dbCustomTable Set dbCustomTable = SDB.Database.OpenSQL(StrQuery) If Not dbCustomTable.EOF Then dbPlayCount = Int(dbCustomTable.StringByName("arNoP"))
I would guess I'd have to start with that initial line:
Changing it to whatever code represents Count(Played.All) and Count(Played.EachDifferentSongID) would seem to do the trick - what would be the commands for this?