473,569 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Removing out of hours time

Hello Chaps,

Just a little sounding on removing out of hours from some datetime
date that I have.
Basically we have a helpdesk that logs calls when they are entered and
when they are resolved. Now, if this happens during the day we just
subtract one date from the other to give the time it took to resolve
the issue. If it is not solved during the day we have an additional 11
hours to add due to people going home and not worrying about peoples
printers which is good but it buggers up stats that I'm trying to
produce.

I haven't got anywhere with this at the mo and am looking at a routine
that compares the resolved time and see's is there is more that 24
hours difference and if so remove 11 hours but wondered if you bright
sparks had any ideas
(also once I write something I tend to find the answer straight after
to confirm me stoppidity).
Any ideas let us know.

Ginters
Jul 20 '05 #1
3 1942
nib
John McGinty wrote:
Hello Chaps,

Just a little sounding on removing out of hours from some datetime
date that I have.
Basically we have a helpdesk that logs calls when they are entered and
when they are resolved. Now, if this happens during the day we just
subtract one date from the other to give the time it took to resolve
the issue. If it is not solved during the day we have an additional 11
hours to add due to people going home and not worrying about peoples
printers which is good but it buggers up stats that I'm trying to
produce.

I haven't got anywhere with this at the mo and am looking at a routine
that compares the resolved time and see's is there is more that 24
hours difference and if so remove 11 hours but wondered if you bright
sparks had any ideas
(also once I write something I tend to find the answer straight after
to confirm me stoppidity).
Any ideas let us know.

Ginters


Have you looked at the DATEDIFF() and DATEADD() functions, they seem to
be just what you need. :D

Zach
Jul 20 '05 #2
Cheers Zach your right with the datediff and here's how I think yon
remove out of hours time (there is few issues if you can spot them!)

1. Helpdesk opens at 9am and closes at 6pm

select issue_name, date_submitted, date_resolved,
-- so we display the issue name, the time it was added and the time it
was resolved. Not interested in ones not resolved.

datediff(minute , date_submitted, date_resolved) as 'Diff_Min',
--difference in minutes. Shows me the time to resolve in minutes

datediff(day, date_submitted, date_resolved) as 'Diff_Day',
--number of days before resolution.

datediff(day, date_submitted, date_resolved) * (15*60) as 'Difference',
--This takes the total number of days and subtracts the dead time which
in this case is 15 hours and then multiplies this by 60 to get the
minutes. This is the total dead time in minutes.

datediff(minute , date_submitted, date_resolved)-datediff(day,
date_submitted, date_resolved) * (13*60) as 'DiffTo_min',
--subtracting the total minutes by the dead time minutes gives me the
total 'live minutes'

(datediff(minut e, date_submitted, date_resolved)-datediff(day,
date_submitted, date_resolved) * (13*60))/60 as 'DiffTo_hrs'
-- this is the same as above but in hours.
from test_table2

What dya think?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
nib
John McGinty wrote:
Cheers Zach your right with the datediff and here's how I think yon
remove out of hours time (there is few issues if you can spot them!)

<snipped>

What dya think?


Heh, I think that without DDL and sample data reading that makes my head
hurt. :D

Zach
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
1254
by: Geronimo W. Christ Esq | last post by:
Are there any scripts or tools out there that could look recursively through a group of C/C++ source files, and allow unreferenced function calls or values to be easily identified ? LXR is handy for indexing source code, and for a given function or global variable it can show you all the places where it is referenced. It would be really...
6
1948
by: christopher.secord | last post by:
I have a table containing typed log entries. One log entry is supposed to be created every twelve hours, but sometimes there are gaps. I need to create a report showing the time of entry, and the actual log entry. I can't just list the contents of the log table, because if I do that there will be dates missing. Instead, when there isn't a...
1
13593
by: sg_s123 | last post by:
============================================================================ 02-Feb-04 03-Feb-04 Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr- 1900hr- Number Name 1200hr 1700hr 1900hr 2200hr 1200hr 1700hr 1900hr 2200hr ============================================================================...
1
4754
by: THDWWSIJQUOK | last post by:
I have (or should I say "had") a module which I invested quite a few hours of work into. I was poking around trying to rename the module and instead wound up removing the darn thing. It's been a long time since I've lost any work because I normally make backups and have the experience not to make stupid mistakes like this. I'm still...
1
7406
by: serge | last post by:
Right now the database I am working with is storing time in an Integer data type and is storing the time value in seconds. The application does not allow entering seconds. It accepts minutes and hours. I have a report where it is doing: SELECT SUM(TIMEENTERED) and the SUM is *blowing* up as the SUM is reaching
6
6093
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or more minutes. 'REMOVE DUBLICATED VALUE FROM ARRAY +++++++++++++++++ Dim col As New Scripting.Dictionary Dim ii As Integer = 0
22
14944
by: Drum2001 | last post by:
I have a table that tracks employee times. I have a column (Date/Time). Users, through a form, enter how long it takes them to complete a task. For example, 03:45 = 3 hours and 45 mins. I am running the following query: SELECT Sum(Nz(.,0)) AS SumOfNumberOfCompletions, Format(Sum(Nz(.,0)),"Short
6
4228
by: richbneal | last post by:
I really like the site so far and this is my first post. I have looked through some of the archives with no luck. I have also read the posting guidelines and will do my best to be clear and accurate with my problem. I am working with Access 2k / Win 2k. I have some experience and must have this figured out before Aug1. What i am tasked with...
18
13022
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st 1901. For Example: the number 3566839 is 27.11.07 7:00. To calculate this in Excel I use this:...
0
7694
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.