Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dimoss
Yak Posting Veteran
52 Posts |
Posted - 2007-07-17 : 11:55:17
|
| Hi,I use the following query in my stats page to find the unique visitors and the pages they visited per day in a given month.SELECTCONVERT(CHAR(10),LogDate,103) As Date_,Count(DISTINCT LogRemote_Addr) As Visitors,Count(Lid) As PagesFROM LogWHERE LogMonth=7Group by CONVERT(CHAR(10),LogDate,103)ORDER BY CONVERT(CHAR(10),LogDate,103)I would like to have the totals (Sum) of the "Visitors" and "Pages" also for the given month.I think I have to use a subquery to accomplish that but I can't figure it out. I would appreciate your help.Thanks,www.tabletennis.gr |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-07-17 : 12:06:20
|
| Please post some sample data and expected output.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
dimoss
Yak Posting Veteran
52 Posts |
Posted - 2007-07-17 : 12:12:09
|
| Ok. I have the following fileds.LogDate = date of visitLogRemoteAddr = ip of the visitorLid = a common id (autonumber)The exampleLid LogDate LogRemoteAdd1 15/7/2007 85.82.141.12 15/7/2007 85.82.141.13 15/7/2007 85.21.140.584 16/7/2007 85.21.140.585 16/7/2007 193.54.147.16 17/7/2007 193.57.100.1This set according to my query will produceDate Visitors Pages15/7/2007 2 316/7/2007 2 217/7/2007 1 1I would like to take also the Sum of Visitors and Pages which is 5 and 6 correlatively.I think it's more clear now.Thankswww.tabletennis.gr |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|