Doing some operation on a Date Field
Field field = (DSL.month(dateField).add(12 - startMonthOfYear).div(3));
Then truncating the field to get the integer value
Field quarterField = DSL.trunc(field2);
The query it generates is like
select trunc(((extract(month from my_date_field) + ?) / ?), 'DD') "date" from my_table
trunc seems to add this 'DD'
Now this 'DD' is causing problem while running the query 'ORA-01722: invalid number' , if I remove the 'DD' .. the query runs completely fine.
How do I remove this 'DD'?
Oracle 12c is the SQL dialect