'How to perform datediff using derived column expression in Azure DataFactory

I have a query in Sql which gives the result of activitystarttime and activityendtime in sec. Below is the query in sql DATEDIFF_BIG(second,ActivityStartTime, ActivityEndTime) as [DiffInTime]

I have to write the same using derived column expression.



Solution 1:[1]

Create a new column in Derived Column's Settings and write the below expression in Expression Field for this column. The new column will have the difference in seconds.

toInteger(ActiveEndTime-ActiveStartTime)/1000

enter image description here

Note: Make sure that ActiveEndTime and ActiveStartTime should be in timestamp format.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 UtkarshPal-MT