I want to add a custom column to a table component using datediff

Hello - I'm trying to add a column to a table that shows the duration of a meeting. I have column end_time and start_time and the table component pulls from a join query, combining many tables in my database. I have created a query that actually finds the difference between the two columns (start_time and end_time) but don't know how to connect it back to my join query. I'm attaching a screenshot of the join query and the datediff query. Would appreciate any support on this as I've been struggling for a while!


You could also simply add a custom column that looks at both start and end date/times and using moment() and .diff
https://momentjs.com/docs/#/displaying/difference/

Hey @Liz_Soolkin! As @ScottR mentioned, moment's diff method is a great way to do this. I set this up to use a JS query to add a duration column to the pre-existing SQL data. Then use that JS query as the underlying data source for the table.

Let me know if you have any other questions!