You should be able to use something like the following...
SELECT
cast(substr(date,1,8)||'01' as DATE FORMAT 'YYYY-MM-DD') AS Begin_of_month_Date
,CAST(substr(ADD_MONTHS (CAST (substr(date,1,8)||'15' AS DATE FORMAT 'YYYY-MM-DD'), 1),1,8)||'01' AS date format 'yyyy-mm-dd') - 1 AS...