I am using the Dataiku DSS platform for data recipes and in one of my datasets, there are four columns named AvgACWTime_avg
, AvgSpeedAns_avg
, AvgACDTime_avg
and AvgAbanTime_avg
for which there are numerical time values in seconds, simply stored as decimals. I would like to convert these into a HH:MM format, what code do I need for this? Assume that I would like any new columns to be called ACWmin
, Speedmin
, ACDmin
and Abanmin
.
I have tried using the following formulas:
WITH ACWmin AS
(
SELECT *
FROM (VALUES (AvgACWTime_avg)) AS t(AvgACWTime_avg)
)
SELECT
CAST(AvgACWTime_avg AS decimal(12, 2)) / 60
FROM
ACWmin;
FROM "database"."dataset"
and
DECLARE ACWmin datetime
SELECT ACWmin = DATEADD(mi, AvgACWTime_avg * 60, '00:00')
FROM "database"."dataset"
Neither of them have worked for me. I don't understand whether I am missing something with syntax or there is something else that I'm not doing correctly.