Submit articles - Property in Qatar - Electronics - Debt Consolidation - Debt Consolidation

PDA

View Full Version : Getting Number by user


danjapro
Nov 17th 2005, 7:46 am
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

BurgerKing
Nov 20th 2005, 8:59 pm
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