Hi,
Presuming that both the dates are of the same datatype(Date), it is not necessary for casting them.
By the way, DAY TO SECOND in the query ? If its an alias , then wrap it in quotes like
SELECT org,workbasket,task,
AVG(close_date - creation_date) "DAY TO SECOND",COUNT(task_id)...