format_datetime datetime expected
albertoRamon opened this issue · comments
Alberto Ramón Portolés commented
This works:
ADFActivityRun
| where TimeGenerated > ago(3d)
| extend duration2 = (End - Start)
This fail:
ADFActivityRun
| where TimeGenerated > ago(3d)
extend duration2 = format_datetime((End - Start),'y-M-d h:m:s.fffffff')
Redundant but just in case, fail too
ADFActivityRun
| where TimeGenerated > ago(3d)
extend duration2 = format_datetime((todatetime(End) - todatetime(Start)),'y-M-d h:m:s.fffffff')
Alexander Sloutsky commented
The function format_datetime() expects datetime value (as error described).
For formating timespans: use https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/format-timespanfunction
Alberto Ramón Portolés commented
End and Start, is date time
End - Start, is date time
and just in case: todatetime(start) is datetime
Alexander Sloutsky commented
If End is datetime - and Start is datetime, then
End-Start is timespan
Alberto Ramón Portolés commented
ohh, thanks !!