Ah, okay, I think I found it. I'm trying this:
DSL.field("now() at time zone 'UTC'", SQLDataType.TIMESTAMP)
On Wed, Jul 22, 2015 at 11:24 AM, Robert DiFalco <[email protected]>
wrote:
> 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 a topic in the
> Google Groups "jOOQ User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jooq-user/rhV8H6bV9vA/unsubscribe.
> To unsubscribe from this group and all its topics, 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.