Hello,

Use DSL.timestampAdd():
https://www.jooq.org/javadoc/latest/org/jooq/impl/DSL.html#timestampAdd-org.jooq.Field-java.lang.Number-org.jooq.DatePart-

I guess we should add timestampSub() to be more consistent with dateSub().
I've created a feature request for this:
https://github.com/jOOQ/jOOQ/issues/7374

Hope this helps,
Lukas

2018-04-01 15:18 GMT+02:00 <[email protected]>:

> 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())
>     )
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to