title: Look for inactive time frame in personnel activity table in SQL
body: <p>I am working on a SQL query that looks at personnel activity of more than 90 mins in that datetime field. Is there an easy way to query that?</p>
  <p>So for example, If employee '1544' is inactive for 92 minutes, I am would just be looking for a return record of Employee ID, total inactive minutes and Date time of start and end of inactivity.</p>
  <p>I understand then when off duty they will be inactive for more than 90 minutes so maybe just look for inactivity between 90 mins and 180 minutes?</p>
  <pre><code>SELECT        dbo.Personnel.ID AS Personnel_ID, dbo.Personnel.Emp_Name, dbo.Activity_Log.Date_Time AS Activity_TimeStamp, dbo.Activity_Log.Activity, dbo.Activity_Log.Terminal
  FROM            dbo.Activity_Log INNER JOIN
                           dbo.Personnel ON dbo.Activity_Log.Personnel_ID = dbo.Personnel.ID INNER JOIN
                           dbo.Response_Master_Incident ON dbo.Activity_Log.Master_Incident_ID = dbo.Response_Master_Incident.ID
  WHERE        (dbo.Personnel.ID = 1542) OR
                           (dbo.Personnel.ID = 1544) OR
                           (dbo.Personnel.ID = 1545) OR
                           (dbo.Personnel.ID = 1546) OR
                           (dbo.Personnel.ID = 1547) OR
                           (dbo.Personnel.ID = 1548) OR
                           (dbo.Personnel.ID = 1549) OR
                           (dbo.Personnel.ID = 1550) OR
                           (dbo.Personnel.ID = 1551) OR
                           (dbo.Personnel.ID = 1552) OR
                           (dbo.Personnel.ID = 1553) OR
                           (dbo.Personnel.ID = 1554) OR
                           (dbo.Personnel.ID = 1555) OR
                           (dbo.Personnel.ID = 1556)
  </code></pre>