Hi
can this solve your problem on hand?
select
substr('03060912',cast(right(quarter('2014/07/30'),1,2) asdecimal(1,0))*2-1,2) from dummy
This would work for any year as last month of quarter is common set irrespective of year.
if you get quarter from a source, cast(right(quarter('2014/07/30'),1,2) asdecimal(1,0)), can simply be replace with the quarter column.
kind regards
K Sudhakaran