adding number in the sql string [message #372236] |
Sun, 21 January 2001 10:21 |
Brad Wickwire
Messages: 1 Registered: January 2001
|
Junior Member |
|
|
I am trying to write a hit counter and i need it to add all the hits per each day together in the sql string. i need them added together before i output the data cause it loops thru all 12 months in the year and outputs there total unique users and total page views. here is the sql string i am trying so far. i just added ADD to show what i want added.
strSQL ="SELECT DATEPART(month, SiteStatistics_HITS.DateOfUserHit) AS MonthNumber, "
strSQL = strSQL & "ADD(SiteStatistics_HITS.TotalUsers) AS dbTotalUsers, "
strSQL = strSQL & "ADD(SiteStatistics_HITS.UniqueUsers) AS dbUniqueUsers "
strSQL = strSQL & "FROM SiteStatistics_HITS "
strSQL = strSQL & "WHERE DATEPART(year, SiteStatistics_HITS.DateOfUserHit)='" & strSiteStatisticsYear & "' "
strSQL = strSQL & "GROUP BY DATEPART(month, SiteStatistics_HITS.DateOfUserHit), "
strSQL = strSQL & "DATEPART(year, SiteStatistics_HITS.DateOfUserHit) "
strSQL = strSQL & "ORDER BY MonthNumber DESC"
set rs = my_Conn.Execute (strSQL)
You can see the page I am working on here...
http://www.freeaspcode.net/code/asp/applications/site_statistics/visitors.asp?report=Month
PLEASE EMAIL ME THE ANSWER
Brad
|
|
|