Jump to content

Stephen Weiler

Hornbill Users
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Stephen Weiler

  1. I've developed a Direct SQL query that gives me what I need, but I can't find a way to use this / replicate this in Reports / in some method others can run. Can we use SQL functions in Reports?

    My Direct SQL is below. The measures I'm looking for are in bold font. Can I get these same results using Reports?

    select 
        h_pk_reference TicketNumber,
        h_summary Summary,
        h_fk_priorityname priority,
        h_ownername owner,
        IF(h_ownername = h_lastmodifiedusername, 'Yes','No') LastUpdatedByOwner,
        h_datelogged LogDate,
        h_datelastmodified lastmodified,
        TIMESTAMPDIFF(HOUR,h_datelastmodified,CURRENT_TIMESTAMP()) AS HoursSinceUpdate,
        ROUND(TIMESTAMPDIFF(HOUR,h_datelastmodified, CURRENT_TIMESTAMP())/24,0) AS DaysSinceUpdate,

        h_lastmodifiedusername lastmodifiedby,
        h_status status
    from h_itsm_requests
    where h_status not in('status.closed','status.resolved','status.cancelled')
    limit 1000

  2. I'm subtracting one date from another, hopefully to determine the elapsed time between the two dates. The query completes, but I cannot determine the unit of measure for the result. I'm hoping to know the number of hours (rounded up) between these dates.

     

    select 
        h_datelogged,
        h_dateresolved,
        h_dateresolved-h_datelogged Difference
    from h_itsm_requests
    limit 2

    Does anyone know the default unit of measure?

     

    Thanks!

    image.thumb.png.2ced70e483be959b9d6139339f60d3ea.png

×
×
  • Create New...