I need to show date_diff by day as a decimal value in Presto Athena

ok… do you use 1440 or 1440.0?

otherwise you have to CAST the datediff to decimal.

CAST(“date_diff”(‘minute’, scheduled__arrival_time_local, actual_arrival_time_local) AS DECIMAL(5,1))/1440.0

this should do the trick

1 Like