Hi I am trying to create a report based on the AUDIT settings in ServiceDesk. I have everything working except unable to perform a WHERE clause with the AUDITTIME and <from_today>/<to_today> templates. Wether I take the AUDITTIME out of my WHERE clause or leave it in I get the same results. See code below:
SELECT DATE_FORMAT(FROM_UNIXTIME(wsah.AUDITTIME/1000),'%M %d, %Y, %k:%i') "Last Scanned", wsah.AUDITSTATUS "Scan Status", workstation.WORKSTATIONNAME "Workstation",deptDef.DEPTNAME 'Department',wsfields.UDF_CHAR1 'Owner' FROM SystemInfo workstation LEFT JOIN Workstation_Fields wsfields ON workstation.WORKSTATIONID=wsfields.WORKSTATIONID LEFT JOIN Resources resource ON workstation.WORKSTATIONID=resource.RESOURCEID LEFT JOIN ResourceOwner rOwner ON resource.RESOURCEID=rOwner.RESOURCEID LEFT JOIN DepartmentDefinition deptDef ON rOwner.DEPTID=deptDef.DEPTID LEFT JOIN SystemInfoDomain sysInfod ON workstation.WORKSTATIONID=sysInfod.WORKSTATIONID LEFT JOIN DomainInfo dominf ON sysInfod.DOMAINID=dominf.DOMAINID LEFT JOIN audithistory wsah on workstation.WORKSTATIONID=wsah.WORKSTATIONID WHERE (wsah.AUDITTIME > <from_today>) ORDER BY 1, 2