You could do it with a query but most of the time people utilize the escalation points as you can define an elapsed time attribute and interval. For example, in our demo system we have this as the starting query to get all records associated to this SLA
historyflag=0 and ticketuid in (select ownerid from slarecords where ownertable= 'TICKET' and slanum= '1001' )

Then in the escalation points, we have the targetfinish within 1 hour (you would change this from -1 to -2).

This way Maximo will build the criteria for you without you having to worry about how to do it on your platform.
------------------------------
Steven Shull
------------------------------
Original Message:
Sent: Thu May 05, 2022 01:36 AM
From: Shlomo Shvartz
Subject: Email message about the SLA that is about to pass
You have an idea of a query how to get the incidents two hours before the sla time passes
------------------------------
Shlomo Shvartz
Original Message:
Sent: Wed May 04, 2022 08:13 AM
From: Steven Shull
Subject: Email message about the SLA that is about to pass
SLAs were designed to be utilized with escalations to send the communications. We even provide a tab inside of SLA to manage the escalation. Is there something about escalations that aren't working for your use case?
------------------------------
Steven Shull
Original Message:
Sent: Tue May 03, 2022 03:58 AM
From: Shlomo Shvartz
Subject: Email message about the SLA that is about to pass
Hi
Which is the best way to send an email alert two hours before the SLA time expires
Thanks for the help
------------------------------
Shlomo Shvartz
------------------------------
#AssetandFacilitiesManagement
#Maximo