Hello all I'm trying to work on a conditional statement where I get the
MAX time from each table but I have to minus two minutes from the other.
I have tried using dateSub unfortunately it just returns to me a Date. TimeStamp also does not work for dateSub so I am quite lost.
Any help would be highly appreciated.
Here is the code I have so far:
.and(MEASUREMENT.TIME
.between(context.select(max(AGG_MEASUREMENT_MINUTE.TIME)).from(AGG_MEASUREMENT_MINUTE).asField())
.and(context.select(dateSub(max(MEASUREMENT.TIME).cast(Date.class),2,DatePart.MINUTE)).from(MEASUREMENT).asField())
)