Getting Number by user

Discussion in 'C#' started by danjapro, Nov 17, 2005.

  1. #1
    Here is my SQL code in my asp page that calls the number od downloads made from tbldownload, but I want to get specfic with the number of downloads by user from tbluser

    Download count sql
    Set rsDownloadAdmin = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT downloadid, downloadtitle, downloadcount FROM tbldownload ORDER BY DownloadID"
    rsDownloadAdmin.Open strSQL, adoCon

    This works fine , I just want to add the statment and syntax that will show downloads by spefic user or user id
     
    danjapro, Nov 17, 2005 IP
  2. BurgerKing

    BurgerKing Active Member

    Messages:
    397
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Hi,

    Try

    Download count sql
    Set rsDownloadAdmin = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT UserID, count(downloadid) FROM tbldownload group by UserID"
    rsDownloadAdmin.Open strSQL, adoCon

    This will return the total number of downloads for each UserID
     
    BurgerKing, Nov 20, 2005 IP