gINT: Use NextDepth function inside SQL

Hi All,

For a project, I need to get the difference between current depth and the next depth in SQL. I've tried the following code at it fails. I also tried SQL LEAD and it seems it's not supported by gINT. Any idea how to get both current and next depth in SQL? Thanks.

<<Sql(_
SELECT  ([SAMPLE].[Depth]) _
From [SAMPLE] _
Where [SAMPLE].[PointID] = '<<PointID>>' _
AND NEXTDEPTH ([SAMPLE].[DEPTH]) - [SAMPLE].[DEPTH] < 2 _
)>>