Hello
Can someone help me with this one please! Im working on a service level tracking database which records the times that a service goes down during the day (DowntimeStart/DowntimeEnd) and compares this to the times that it is required to be available (SLAStart/SLAEnd). I want to return the amount of time the service was down during the SLA period in minutes. - Date, DowntimeStart, DowntimeEnd, SLAStart, SLAEnd
-
1/1/08, 15:00, 23:00, 18:00, 20:00.
-
2/1/08, 15:00, 16:00, 15:30, 20:00.
The result for record 1 above should be 120 minutes.
The result for record 2 above should be 30 minutes.
Hope you can help....
Regards
Gary
9 1649 @garyb2008
Gary, please clarify something for me before we proceed. In Record #1, the Down Time Start (DowntimeStart) was 3 hours prior to the Available Time Start (SLAStart), namely 15:00 ==> 18:00. The Down Time End (DowntimeEnd) also extended 3 hours passed the allowable Available Time End (SLAEnd), namely 23:00 ==> 20:00. Should not the result for Record 1 be 360 minutes?
NeoPa 32,556
Expert Mod 16PB
Gary, a query with the following SQL embedded in it should help : - SELECT [Date],
-
IIf([DowntimeEnd]<[SLAEnd],[DowntimeEnd],[SLAEnd])-
-
IIf([DowntimeStart]>[SLAStart],[DowntimeStart],[SLAStart]) AS SLADownTime
-
FROM ...
I have no table information supplied so you'll have to fill that info in for yourself ;)
NeoPa 32,556
Expert Mod 16PB @ADezii
Downtime Start / End specifies the time the system was actually down.
SLA Start / End specifies the time we actually care about the system being down.
Although the system was down for 8 hours (480 mins = 23:00 - 15:00), we only care that it was down all the time (2 hours) between 18:00 to 20:00 (120 mins).
@NeoPa
Gotcha! Thanks for the explanation.
NeoPa 32,556
Expert Mod 16PB
No worries :)
It's rare enough that I even understand what an OP is asking for, so it's worth posting when I do ;)
Here is a rather weird solution that I came up with, probably not even Post-Worthy, but I'll throw it up here anyway, just in case no other alternative works! (LOL).
Hi Guys
Thanks for looking into this while i was away, was havin a time out from the project over christmas. I think ill go with NeoPa's solution for this, but im keeping your function ADezii's as with a few modifications it may solve another requirement i know will also be needed.
Happy new year all
Gary
Regards
Gary
@garyb2008
Same here Gary, from all of us at Bytes!
NeoPa 32,556
Expert Mod 16PB
I think a lot of us had a time-out over Christnmas Gary :)
I'm glad this is clearer now. Have a very Happy New Year :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: querypk |
last post by:
X-No-Archive: yes
Can some one help me improve this block of code...this jus converts the
list of data into tokens based on the range it falls into...but it
takes a long time.Can someone tell me...
|
by: androtech |
last post by:
Hello,
I'm looking for a function that returns a date range for a specified week
number of the year.
I'm not able to find functions like this anywhere. Any pointers/help would
be much...
|
by: Miller |
last post by:
Hi,
Can someone tell me how to calculate MFLOPS for the following C# code
(on a Pentium 4 2.0 Ghz)?
for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
{
for (k=0; k<n; k++)
|
by: jdcrief |
last post by:
Complier: Visual C++ 2005 Express Edition
The program I wrote will compile and execute, but the output is always
the same, no matter what number is entered in for the radius of the
circle. ...
|
by: dos.fishing |
last post by:
Hello,
I'm writing a function that should do the following:
/**
* Calculate and return fraction of valueA where max fractions is 31.
* param valueA A five bit value, 0-31.
* param valueB The...
|
by: simchajoy2000 |
last post by:
Hi,
I need to calculate a range of colors given the beginning and ending
colors in hex values (i.e. blue to red). I know there is a logic to
hex numbers and there is probably a fairly simple...
|
by: Umesh |
last post by:
i want to calculate the time required to execute a program. Also i
want to calcute the time remaining for the execution of the program.
how can i do that?
pl mention some good websites for...
|
by: Rickster66 |
last post by:
I have a database where order numbers are entered by a group of 25 users. The Access database is split. As each order number is entered, a time stamp using a general format is used on the table. Now,...
|
by: rcollins |
last post by:
I ahve a database that I put together to keep track of the office supplies. We input what has been purchased and what goes out. When I run a report, usually it is just for a month, but I have a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |