Hey Ian,
Lukas would be more specific about best practice, but this is how we solved
the problem:
Field<Date> truncDay = Factory.field("trunc({0}, {1})", SQLDataType.DATE,
YOUR_FIELD_GOES_HERE, inline("DD"));
HTH,
Ben
On Thu, Dec 13, 2012 at 4:34 PM, Ian Clarke <[email protected]> wrote:
> I'd like to aggregate reporting data that is currently stored hourly in a
> table, such that it is also aggregated by day (I have a column that
> specifies the interval, HOUR, DAY, or WEEK).
>
> Postgres has a useful function called DATE_TRUNC for this, however I am
> using Jooq with MySql.
>
> How can I do this with Jooq?
>
> Many thanks,
>
> Ian.
>