public static Field<Integer> periodDiff(final Field<? extends Date> date1,
                                            final Date date2) {
        return DSL.field("period_diff(extract(year_month from {0}), extract(year_month from {1}))",
                SQLDataType.INTEGER, date1, date2);
    }
Converts a time in millis since epoch to a {@link java.sql.Date}
stroom-db-util/src/main/java/stroom/db/util/JooqUtil.java