Use the following code but select the element before the last
LIST_ITEM.TopIndex = LIST_ITEM.Items.Count - 1
Use the following code but select the element before the last
LIST_ITEM.TopIndex = LIST_ITEM.Items.Count - 1
Very simply:
CONVERT(TIME,Date2 - Date1)
For example:
Declare @Date2 DATETIME = '2016-01-01 10:01:10.022'
Declare @Date1 DATETIME = '2016-01-01 10:00:00.000'
Select CONVERT(TIME,@Date2 - @Date1) as ElapsedTime
Yelds:
ElapsedTime
----------------
00:01:10.0233333
(1 row(s) affected)