Query Report Error - LONGTODATE
Hello,
I am running this query on Power BI and I am receiving the following error message:
ERROR: function longtodate(bigint) does not exist
After looking in the forum, it seems to be that longtodate is a native function for the query editor in the servicedesk. Is there a way to convert the dates in those columns using another non servicedesk function?
This is the query in question that I am using:
- SELECT wo.WORKORDERID AS "Request ID", longtodate(wo.CREATEDTIME) AS "Created Time", longtodate(wo.RESOLVEDTIME) AS "Resolved Time", aau.FIRST_NAME AS "Requester", cd.CATEGORYNAME AS "Category", scd.NAME AS "Subcategory", icd.NAME AS "Item", wo.TITLE AS "Subject", ti.FIRST_NAME AS "Technician", std.STATUSNAME AS "Request Status", dpt.DEPTNAME AS "Department" FROM WorkOrder wo LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID LEFT JOIN DepartmentDefinition dpt ON wo.DEPTID=dpt.DEPTID LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID LEFT JOIN SubCategoryDefinition scd ON wos.SUBCATEGORYID=scd.SUBCATEGORYID LEFT JOIN CategoryDefinition cd ON wos.CATEGORYID=cd.CATEGORYID LEFT JOIN ItemDefinition icd ON wos.ITEMID=icd.ITEMID LEFT JOIN SDUser td ON wos.OWNERID=td.USERID LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID WHERE ( ( ( longtodate(wo.CREATEDTIME) >= 1577851200000 ) AND ( ( longtodate(wo.CREATEDTIME) != 0 ) AND ( longtodate(wo.CREATEDTIME) IS NOT NULL ) ) ) AND ( ( longtodate(wo.CREATEDTIME) <= 1609473599000 ) AND ( ( ( longtodate(wo.CREATEDTIME) != 0 ) AND ( longtodate(wo.CREATEDTIME) IS NOT NULL ) ) AND ( longtodate(wo.CREATEDTIME) != -1 ) ) ) ) AND wo.ISPARENT='1'
Our database is postgres
New to ADSelfService Plus?