TMaxIfID()

TMaxIfID(a;b;c;d) has the same functionality like TMaxIf(), but returns the minimum ID of the results with ID a to b, which is greater than or equal to c but less than or equal to d.