There are two ways how you can unmanaged interface.
1. unmanage whole node
2. unmanage specific interface
Following select should cover both cases (it's UNION of two selects so you can remove one if you would like to see interfaces unmanaged with the first or the second way):
--Unmanage Nodes with interfaces
SELECT n.Caption
, i.Caption
, DATEADD(mi, DATEDIFF(mi, GETUTCDATE(), GETDATE()), n.UnManageFrom) AS UnmanagedFrom
, DATEADD(mi, DATEDIFF(mi, GETUTCDATE(), GETDATE()), n.UnmanageUntil) AS UnmanagedUntil
,'NO' AS OnlyInterface
FROM Nodes n JOIN Interfaces i ON (n.NodeID=i.NodeID)
WHERE n.UnManageFrom>GETUTCDATE()
AND (i.UnManageFrom IS NULL or i.UnManageFrom<GETUTCDATE())
UNION
--Unmanaged interfaces
SELECT n.Caption
, i.Caption
, DATEADD(mi, DATEDIFF(mi, GETUTCDATE(), GETDATE()), i.UnManageFrom) AS UnmanagedFrom
, DATEADD(mi, DATEDIFF(mi, GETUTCDATE(), GETDATE()), i.UnmanageUntil) AS UnmanagedUntil
,'YES' AS OnlyInterface
FROM Nodes n JOIN Interfaces i ON (n.NodeID=i.NodeID)
WHERE i.UnManageFrom>GETUTCDATE()
UnManageFrom and UnManageUntil is in UTC so it has to be converted to Local time. "NO" in "OnlyInterfaces" column means the whole node was unmanaged. "YES" means, specific interface was unmanaged.