473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Time difference from end time of record to now.

Hi all,

I have a database that records issues and incidents based on different priorities.

I am trying to write a query to show the time difference since the last incident depending on priority.

I.e. difference between End date/time and Now where priority = 1 and the same where the priority = 2.

What I have so far is:

Datediff: DateDiff("n",[date resolved],Date())

Timediff: DateDiff("n",[time resolved],now())

Total mins: ([timediff]+[datediff])

I am having difficulty in making this work by incorporating the priorites however.

Can this be done?

Thanks
Gareth
Nov 15 '11 #1
3 1667
Rabbit
12,516 Expert Mod 8TB
I don't know what you mean. Some sample data would go a long way.
Nov 15 '11 #2
I've got it. I made it work by subtracting the time from the Date/Time resolved of the last incident to Now()

I sorted it descending so the latest incident was at the top and then only returned the top 1 row.
Nov 16 '11 #3
NeoPa
32,556 Expert Mod 16PB
That's good thinking Gareth but will cause issues for multiple groups.

What you need to be looking at is a GROUPed query with aggrgates where you use Min() of the value of (Now() - [DateinRecord]) and GROUP BY [Priority].
Nov 17 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John | last post by:
Hi I am trying to find difference between two time values in hours. I have tried the following? ? dateDiff("h", #23:00:00#, #23:00:00#) gives 0 as expected. ? dateDiff("h", #00:00:00#,...
1
by: Sunny | last post by:
I am interested in finding out the time it takes to complete a certain section of my source code How do i determine the time difference between the beginning of a process and its end. I need to get...
1
by: Usman Ghani | last post by:
Hi There, I want to display below page creation time and so I have two variables as: Dim start_time As New DateTime Dim end_time As New DateTime First I am storing value in start_time on page...
3
by: Richard | last post by:
Hi, Is there any way to get the time difference between Central(US) and GMT in vb.net. I'll appreciate your help/suggestion. Thanks RC
2
by: cmrhema | last post by:
Hello I have a table GPSDATA which consists of VehicleNo,Speed,CurrentDate,slno,status This data gets updated every minute.And every minute the slno(serial no) will be incremented...
2
by: idealfellow | last post by:
I am using the following to get the time: puts Time.now --> starting of my script <MY CODE> puts Time.now --> end of my script I want to get the Time difference between two Time.now...
3
by: Steve | last post by:
I am trying to calculate elapsed travel times for flights. My plan is to enter the local departure time, the departure city and the local arrival time and city. These times would be standardised...
3
by: RN1 | last post by:
A Form has 2 TextBoxes where in users enter date & time. Example (in mm/dd/yyyy format): 09/20/2008 17:54 (1st TextBox) 09/29/2008 6:13 (2nd TextBox) How do I find out how much time (in...
2
by: Guruganesh | last post by:
i have to calculate the time diference of two file names namely File 1: CBE03KMD_2010_03_08_23_06_36.upl File 2: CBE03KMD_2010_03_08_22_11_47.upl see the date is same but the time is also...
0
by: eneyardi | last post by:
I want to have my program time in, time out system. When someone login, automatically it will record the time it was in, and when logging out, it will record the time out. I want to have a database...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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,...
0
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...

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.