Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Develop query to extract minimum response time and its date stamp, maximum response time and its date stamp

Avatar of edrz01
edrz01Flag for United States of America asked on
Microsoft SQL Server
13 Comments1 Solution152 ViewsLast Modified:
Need assistance in developing a query to extract minimum response time and its date stamp, maximum response time and its date stamp from sample data below. Ideally when the Response Time is greater than 0 then drops to 0 again.

Ideal output would be:
DEVICE          MIN DATETIME       MIN               MAX DATETIME      MAX
ABCDEF        12/10/2014 17:06     875.0 ms      12/10/2014 16:11      917.0 ms
ABCDEF        12/11/2014 11:26     847.0 ms      12/11/2014 9:31        943.0 ms



Sample data (I out in the '<<<MIN', '<<<MAX' for easier identification)
DATE / TIME       Response Time        
12/10/2014 13:36      unknown       
12/10/2014 13:41      unknown       
12/10/2014 13:46      unknown       
12/10/2014 13:51      unknown       
12/10/2014 13:56      unknown       
12/10/2014 14:01      unknown       
12/10/2014 14:06      unknown       
12/10/2014 14:11      unknown       
12/10/2014 14:16      unknown       
12/10/2014 14:21      unknown       
12/10/2014 14:26      unknown       
12/10/2014 14:31      unknown       
12/10/2014 14:36      unknown       
12/10/2014 14:41      unknown       
12/10/2014 14:46      unknown       
12/10/2014 14:51      unknown       
12/10/2014 14:56      unknown       
12/10/2014 15:01      unknown       
12/10/2014 15:06      unknown       
12/10/2014 15:11      899.0 ms       
12/10/2014 15:16      896.0 ms       
12/10/2014 15:21      888.0 ms       
12/10/2014 15:26      890.0 ms       
12/10/2014 15:31      895.0 ms       
12/10/2014 15:36      894.0 ms       
12/10/2014 15:41      887.0 ms       
12/10/2014 15:46      888.0 ms       
12/10/2014 15:51      895.0 ms       
12/10/2014 15:56      897.0 ms       
12/10/2014 16:01      903.0 ms       
12/10/2014 16:06      902.0 ms       
12/10/2014 16:11      917.0 ms       <<<MAX
12/10/2014 16:16      896.0 ms       
12/10/2014 16:21      879.0 ms       
12/10/2014 16:26      882.0 ms       
12/10/2014 16:31      892.0 ms       
12/10/2014 16:36      897.0 ms       
12/10/2014 16:41      900.0 ms       
12/10/2014 16:46      902.0 ms       
12/10/2014 16:51      909.0 ms       
12/10/2014 16:56      887.0 ms       
12/10/2014 17:01      899.0 ms       
12/10/2014 17:06      875.0 ms       <<<MIN
12/10/2014 17:11      unknown       
12/10/2014 17:16      unknown       
12/10/2014 17:21      unknown       
12/10/2014 17:26      unknown       
12/10/2014 17:31      unknown       
12/10/2014 17:36      unknown       
12/10/2014 17:41      unknown       
12/10/2014 17:46      unknown       
12/10/2014 17:51      unknown       
12/10/2014 17:56      unknown       
12/10/2014 18:01      unknown       
12/10/2014 18:06      unknown       
12/10/2014 18:11      unknown       
12/10/2014 18:16      unknown       
12/10/2014 18:21      unknown       
12/10/2014 18:26      unknown       
12/10/2014 18:31      unknown       
12/10/2014 18:36      unknown       
12/10/2014 18:41      unknown       
12/10/2014 18:46      unknown       
12/10/2014 18:51      unknown       
12/10/2014 18:56      unknown       
12/10/2014 19:01      unknown       
12/10/2014 19:06      unknown       
12/10/2014 19:11      unknown       
12/10/2014 19:16      unknown       
12/10/2014 19:21      unknown       
12/10/2014 19:26      unknown       
12/10/2014 19:31      unknown       
12/10/2014 19:36      unknown       
12/10/2014 19:41      unknown       
12/10/2014 19:46      unknown       
12/10/2014 19:51      unknown       
12/10/2014 19:56      unknown       
12/10/2014 20:01      unknown       
12/10/2014 20:06      unknown       
12/10/2014 20:11      unknown       
12/10/2014 20:16      unknown       
12/10/2014 20:21      unknown       
12/10/2014 20:26      unknown       
12/10/2014 20:31      unknown       
12/10/2014 20:36      unknown       
12/10/2014 20:41      unknown       
12/10/2014 20:46      unknown       
12/10/2014 20:51      unknown       
12/10/2014 20:56      unknown       
12/10/2014 21:01      unknown       
12/10/2014 21:06      unknown       
12/10/2014 21:11      unknown       
12/10/2014 21:16      unknown       
12/10/2014 21:21      unknown       
12/10/2014 21:26      unknown       
12/10/2014 21:31      unknown       
12/10/2014 21:36      unknown       
12/10/2014 21:41      unknown       
12/10/2014 21:46      unknown       
12/10/2014 21:51      unknown       
12/10/2014 21:56      unknown       
12/10/2014 22:01      unknown       
12/10/2014 22:06      unknown       
12/10/2014 22:11      unknown       
12/10/2014 22:16      unknown       
12/10/2014 22:21      unknown       
12/10/2014 22:26      unknown       
12/10/2014 22:31      unknown       
12/10/2014 22:36      unknown       
12/10/2014 22:41      unknown       
12/10/2014 22:46      unknown       
12/10/2014 22:51      unknown       
12/10/2014 22:56      unknown       
12/10/2014 23:01      unknown       
12/10/2014 23:06      unknown       
12/10/2014 23:11      unknown       
12/10/2014 23:16      unknown       
12/10/2014 23:21      unknown       
12/10/2014 23:26      unknown       
12/10/2014 23:31      unknown       
12/10/2014 23:36      unknown       
12/10/2014 23:41      unknown       
12/10/2014 23:46      unknown       
12/10/2014 23:51      unknown       
12/10/2014 23:56      unknown       
12/11/2014 0:01      unknown       
12/11/2014 0:06      unknown       
12/11/2014 0:11      unknown       
12/11/2014 0:16      unknown       
12/11/2014 0:21      unknown       
12/11/2014 0:26      unknown       
12/11/2014 0:31      unknown       
12/11/2014 0:36      unknown       
12/11/2014 0:41      unknown       
12/11/2014 0:46      unknown       
12/11/2014 0:51      unknown       
12/11/2014 0:56      unknown       
12/11/2014 1:01      unknown       
12/11/2014 1:06      unknown       
12/11/2014 1:11      unknown       
12/11/2014 1:16      unknown       
12/11/2014 1:21      unknown       
12/11/2014 1:26      unknown       
12/11/2014 1:31      unknown       
12/11/2014 1:36      unknown       
12/11/2014 1:41      unknown       
12/11/2014 1:46      unknown       
12/11/2014 1:51      unknown       
12/11/2014 1:56      unknown       
12/11/2014 2:01      unknown       
12/11/2014 2:06      unknown       
12/11/2014 2:11      unknown       
12/11/2014 2:16      unknown       
12/11/2014 2:21      unknown       
12/11/2014 2:26      unknown       
12/11/2014 2:31      unknown       
12/11/2014 2:36      unknown       
12/11/2014 2:41      unknown       
12/11/2014 2:46      unknown       
12/11/2014 2:51      unknown       
12/11/2014 2:56      unknown       
12/11/2014 3:01      unknown       
12/11/2014 3:06      unknown       
12/11/2014 3:11      unknown       
12/11/2014 3:16      unknown       
12/11/2014 3:21      unknown       
12/11/2014 3:26      unknown       
12/11/2014 3:31      unknown       
12/11/2014 3:36      unknown       
12/11/2014 3:41      unknown       
12/11/2014 3:46      unknown       
12/11/2014 3:51      unknown       
12/11/2014 3:56      unknown       
12/11/2014 4:01      unknown       
12/11/2014 4:06      unknown       
12/11/2014 4:11      unknown       
12/11/2014 4:16      unknown       
12/11/2014 4:21      unknown       
12/11/2014 4:26      unknown       
12/11/2014 4:31      unknown       
12/11/2014 4:36      unknown       
12/11/2014 4:41      unknown       
12/11/2014 4:46      unknown       
12/11/2014 4:51      unknown       
12/11/2014 4:56      unknown       
12/11/2014 5:01      unknown       
12/11/2014 5:06      unknown       
12/11/2014 5:11      unknown       
12/11/2014 5:16      unknown       
12/11/2014 5:21      unknown       
12/11/2014 5:26      unknown       
12/11/2014 5:31      unknown       
12/11/2014 5:36      unknown       
12/11/2014 5:41      unknown       
12/11/2014 5:46      unknown       
12/11/2014 5:51      unknown       
12/11/2014 5:56      unknown       
12/11/2014 6:01      unknown       
12/11/2014 6:06      unknown       
12/11/2014 6:11      unknown       
12/11/2014 6:16      unknown       
12/11/2014 6:21      unknown       
12/11/2014 6:26      unknown       
12/11/2014 6:31      unknown       
12/11/2014 6:36      unknown       
12/11/2014 6:41      unknown       
12/11/2014 6:46      unknown       
12/11/2014 6:51      unknown       
12/11/2014 6:56      unknown       
12/11/2014 7:01      unknown       
12/11/2014 7:06      unknown       
12/11/2014 7:11      unknown       
12/11/2014 7:16      unknown       
12/11/2014 7:21      unknown       
12/11/2014 7:26      unknown       
12/11/2014 7:31      unknown       
12/11/2014 7:36      unknown       
12/11/2014 7:41      unknown       
12/11/2014 7:46      unknown       
12/11/2014 7:51      889.0 ms       
12/11/2014 7:56      889.0 ms       
12/11/2014 8:01      889.0 ms       
12/11/2014 8:06      902.0 ms       
12/11/2014 8:11      894.0 ms       
12/11/2014 8:16      875.0 ms       
12/11/2014 8:21      873.0 ms       
12/11/2014 8:26      878.0 ms       
12/11/2014 8:31      887.0 ms       
12/11/2014 8:36      906.0 ms       
12/11/2014 8:41      883.0 ms       
12/11/2014 8:46      886.0 ms       
12/11/2014 8:51      901.0 ms       
12/11/2014 8:56      886.0 ms       
12/11/2014 9:01      884.0 ms       
12/11/2014 9:06      880.0 ms       
12/11/2014 9:11      875.0 ms       
12/11/2014 9:16      856.0 ms       
12/11/2014 9:21      898.0 ms       
12/11/2014 9:26      857.0 ms       
12/11/2014 9:31      943.0 ms       <<<MAX
12/11/2014 9:36      918.0 ms       
12/11/2014 9:41      871.0 ms       
12/11/2014 9:46      876.0 ms       
12/11/2014 9:51      875.0 ms       
12/11/2014 9:56      891.0 ms       
12/11/2014 10:01      879.0 ms       
12/11/2014 10:06      877.0 ms       
12/11/2014 10:11      861.0 ms       
12/11/2014 10:16      900.0 ms       
12/11/2014 10:21      893.0 ms       
12/11/2014 10:26      885.0 ms       
12/11/2014 10:31      894.0 ms       
12/11/2014 10:36      890.0 ms       
12/11/2014 10:41      884.0 ms       
12/11/2014 10:46      870.0 ms       
12/11/2014 10:51      889.0 ms       
12/11/2014 10:56      883.0 ms       
12/11/2014 11:01      865.0 ms       
12/11/2014 11:06      888.0 ms       
12/11/2014 11:11      896.0 ms       
12/11/2014 11:16      854.0 ms       
12/11/2014 11:21      868.0 ms       
12/11/2014 11:26      847.0 ms       <<<MIN
12/11/2014 11:31      884.0 ms       
12/11/2014 11:36      875.0 ms       
12/11/2014 11:41      890.0 ms       
12/11/2014 11:46      878.0 ms       
12/11/2014 11:51      893.0 ms       
12/11/2014 11:56      unknown       
12/11/2014 12:01      unknown       
12/11/2014 12:06      unknown       
12/11/2014 12:11      unknown       
12/11/2014 12:16      unknown       
12/11/2014 12:21      unknown       
12/11/2014 12:26      unknown       
12/11/2014 12:31      unknown       
12/11/2014 12:36      unknown       
12/11/2014 12:41      unknown       
12/11/2014 12:46      unknown       
12/11/2014 12:51      unknown       
12/11/2014 12:56      unknown       
12/11/2014 13:01      unknown       
12/11/2014 13:06      unknown       
12/11/2014 13:11      unknown       
12/11/2014 13:16      unknown       
12/11/2014 13:21      unknown       
12/11/2014 13:26      unknown       
12/11/2014 13:31      unknown       


Thanks!