Page 1 of 1

[SOLVED]combining records

Posted: Mon Sep 25, 2006 1:57 am
by ryuuka
hello

i have a database wich get the load percentage of the various servers i have.
and this shows me how much work the servers have.
now for the problem: this database is updated every 5 min and the results are placed in a graph (using JPgraph)
but i want every point in the graph to be an update of the last half hour.
example:

this is the record set
Image

and this is the graph
Image


i want the graph to show the highest value for every half hour. without changing the database
(because i might want that info for something else). i think this could be done best with a new query.
btw sr0029 is a name usually filled in by a variable in another page
this is the current one:

Code: Select all

SELECT     TOP 30 LoadPercentage, LastCheck, ServerName
FROM         Gispen_Server_CPU_gebruik
WHERE     (ServerName LIKE 'sr0029')
ORDER BY LastCheck DESC
EDIT:
oh and i also want the lastcheck of the highest loadpercentage to show but i will figure that out later

Posted: Mon Sep 25, 2006 1:58 am
by Luke
Is there a reason why you posted this twice? :?

Posted: Mon Sep 25, 2006 2:00 am
by ryuuka
had a website time out on posting i refreshed it
so i guess thats the reason

edit:
sorry about that
other post has been deleted

Posted: Mon Sep 25, 2006 6:34 am
by ody
Why half an hour? it can be easily done using a single query if you done it by the hour.