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 |
|
ereader
Yak Posting Veteran
50 Posts |
Posted - 2003-04-25 : 01:33:05
|
| Hi ALL-- This graph is displaying the Detail Visit The Number Of Users and the details of the last week visit Per HourSELECT hour1 , [Users Visit]FROM ( SELECT CAST(DATEPART(hh,Online_visit) AS VARCHAR(11)) AS 'Hour1' ,COUNT(Online_visit) AS 'Users Visit' FROM ONLINE_STATISTICS WHERE CONVERT(VARCHAR(11) ,Online_visit,106)=CONVERT(VARCHAR(11) ,Getdate(),106) AND online_visit IS NOT NULL OR DATEDIFF(DAY,Online_visit,GETDATE())=7 GROUP BY CONVERT(VARCHAR(11) ,Online_visit,106), CAST(DATEPART(hh,Online_visit) AS VARCHAR(11)) )table1 ORDER BY CAST(hour1 AS INT)The result is the mix match of the current date data with the last week data hour1 Users Visit----- ------------11 3012 40 13 5011 7012 60 13 50what i'll be looking in the format like this hour1 Users Visit Lastweek----- ------------ --------- 11 30 7012 40 6013 50 50 |
|
|
AndyB13
Aged Yak Warrior
583 Posts |
Posted - 2003-04-25 : 05:12:30
|
| HiHave a look at this article[url]http://www.sqlteam.com/item.asp?ItemID=5741[/url]Andy |
 |
|
|
|
|
|