The Table(Log Analyzer) structure is :

I want to draw a line graph displaying the number of requests per minute. I want to write a query which displays two columns with the following information:
- Date:Hour:Minute
- Number of Requests
I have tried to write a sample query displaying requests per hour:
SELECT ( Str(Datepart(HOUR, TimeLog)) + '.00' ) AS 'From (hours)',
( Str(CASE
WHEN Datepart(HOUR, TimeLog) + 1 = 24 THEN 00
ELSE Datepart(HOUR, TimeLog) + 1
END) + '.00' )AS 'To (hours)',
Count(DISTINCT Request) AS 'Number Of Queries '
FROM LogData
GROUP BY Datepart(HOUR, TimeLog);
The problem with this is when I use MINUTE instead of HOUR it combines the minutes of
all hours and days, so it just displays 60 rows. I want all the rows to be separate according to the day and hour. How can this be achieved?
1 Answer