Next Max Time in second column

Waqas ali

Board Regular
Joined
Nov 6, 2010
Messages
163
dear all,

i have below timings in one column i want to see each next time with previous time in second column as start and end how to write a query?:cool:




CompletedDateTime
22-Nov-15 09:09:31
22-Nov-15 09:10:18
22-Nov-15 09:11:42
22-Nov-15 09:13:46
22-Nov-15 09:15:23
22-Nov-15 09:21:45
22-Nov-15 09:21:50
22-Nov-15 09:22:14
22-Nov-15 09:23:35
22-Nov-15 09:25:36
22-Nov-15 09:27:53
22-Nov-15 09:28:47

<colgroup><col></colgroup><tbody>
</tbody>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Each Record has an ID

Code:
SELECT Sheet1.ID, Sheet1.StartTM, DLookUp("[StartTM]","Sheet1","[ID]=" & [ID]+1) AS NextStartTM, DateDiff("n",[NextStartTM],[StartTm]) AS [Difference in Minutes]
FROM Sheet1;
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,252
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top