Stephen Weiler
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Enhancement Requests
Posts posted by Stephen Weiler
-
-
Thank you! The TIMESTAMPDIFF() function is what I needed. I'm used to native SQL and was trying DATEDIFF() with no luck. I appreciate the help!
- 1
-
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 2Does anyone know the default unit of measure?
Thanks!
Using SQL Functions in Reports?
in Reporting
Posted
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