I have table like this. So here in below table i have
5 Keys with outage type 0 and out of those for only KEYS(192408 ,192412,192410) i have got some duration in seconds
So here duration_seconds is the amount of time the system is down and hence i need to get the %of uptime by dividing the duration_Seconds with total duration and then substract that value by 1 to get the uptime %.
ID
KEY
start_time
end_time
duration_seconds
outage_type
232320
192408
3/19/2015 17:29
3/19/2015 17:29
0
0
232321
192409
3/19/2015 17:29
3/19/2015 17:29
0
0
232322
192410
3/19/2015 17:29
3/19/2015 17:29
0
0
318194
192412
5/15/2015 16:22
5/15/2015 16:22
0
0
318195
192408
5/20/2015 23:48
5/21/2015 0:12
1414
1
318196
192410
5/25/2015 22:30
5/25/2015 23:30
1200
1
318196
192412
5/5/2015 22:30
5/6/2015 8:10
34800
1
Here suppose i need to pull out the average uptime% of the month of may by selecting the Month May from Master Calendar so in above example i have only one KEY 192410,192412 as outage type 1 in the table so for the month of MAY all the other 3 KEYS values should be considered as 100% and then the average of all the percentages should be calculated and shown in TEXT BOX .