Of course you could simly change the FORMAT to 'yyyymm', but why do you cast to a char instead of using native DATEs?
DATE - (EXTRACT(DAY FROM DATE)-1) returns the first day of a month.
Running your code you will notice that it return the next to last day of the previous month.
You probably meant DATE - EXTRACT(DAY FROM DATE)+1, but this is a bit less efficient (two time date arithmetric vs. one date plus one int arithmetric).
Additionally it would fail in the first week of year 1 :-)