Okay, I am trying to write an expression like this in jOOQ.

FROM devices d

WHERE extract(hour from now() at time zone 'UTC' + d.utc_offset)

    BETWEEN 10 AND 22;


The field d.utc_offset is an Day to Second Interval. 

I understand that JOOQ does not allow me to write the "extract(hour from 
now() at time zone 'UTC' + d.utc_offset)" but I was hoping I could do 
something like the following:

Field<Date> now = DSL.createFrield("now() at time zone 'UTC'");

DSL.extract(now.plus(d.utc_offset), DatePart.HOUR).between(10, 22);


But the JOOQ documentation is vast and I couldn't figure out how to do 
that. I'd even be happy to do something like:

where(Field.create("extract(hour from now() at time zone 'UTC' + 
d.utc_offset)", Integer.class).between(10,22))


But I couldn't figure out how to do that either. Is anyone able to point me 
in the right direction?

Thanks! 




-- 
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