Hello,
Why longtodate(no1.notificationdate) doesn't it work in the query below? I need use to_char to convert long to date, because the longtodate function not work.
SELECT wo.WORKORDERID "Chamado",
aau.FIRST_NAME "Solicitante",
wo.TITLE "Assunto",
ti.FIRST_NAME "Tecnico",
qd.QUEUENAME "Grupo",
cd.CATEGORYNAME AS "Categoria",
longtodate(wo.CREATEDTIME) "Data de Criação",
LONGTODATE(wo.RESPONDEDTIME) "1ª Resposta do chamado",
TO_CHAR(((wo.respondedtime-wo.createdtime)/1000 || ' second')::interval, 'HH24:MI:SS') "Tempo de 1ª Resposta",
(select longtodate(con1.createdtime) from conversationdescription left join conversation con1 on conversationdescription.conversationid=con1.conversationid where con1.conversationid in(select max(conversationid) from conversation group by conversation.workorderid) and con1.workorderid=wo.workorderid) "Last requester response",
(select to_char(to_timestamp(no1.notificationdate / 1000.0), 'DD/MM/YYYY HH24:MI') from notification no1 left join notify_workorder nwo1 on no1.notificationid=nwo1.notificationid where no1.notificationid in (select max(notification.notificationid) from notification left join notify_workorder on notification.notificationid=notify_workorder.notificationid group by notify_workorder.workorderid) and nwo1.workorderid=wo.workorderid) "Last Tech reply" FROM WorkOrder wo
LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID
LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN CategoryDefinition cd ON wos.CATEGORYID=cd.CATEGORYID
LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID
LEFT JOIN WorkOrder_Queue woq ON wo.WORKORDERID=woq.WORKORDERID
LEFT JOIN QueueDefinition qd ON woq.QUEUEID=qd.QUEUEID
LEFT JOIN SDUser td ON wos.OWNERID=td.USERID
LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID