I’m good for now. Have a good night.
with Items as (
select wi.Id WorkItem
, wi.name Description
, wi.notes Notes
, lv.name Task
, TP.name Property
, TPV.Text Value
from WorkItems WI
left join ListValuePropertyValues tasks on tasks.WorkItemId = WI.Id
left join ListValues lv on lv.Id = tasks.ListValueId
left join ListValueProperties LVP on lvp.Id = lv.ListValuePropertyId
left join TextPropertyValues TPV on TPV.WorkItemId = WI.Id
left join TextProperties TP on TP.Id = TPV.TextPropertyId
)
select W.*,ts.id
,datetime(ts.start/10000000-62136892800, 'unixepoch' ) begin
,datetime(ts.End/10000000-62136892800, 'unixepoch' ) end
,(ts.start - ts.End)/10000000 - 62136892800
from Items W
join TimeSlices TS on WorkItemId = W.WorkItem