Hi,
My SQL is a little rusty but given a few CASTS, a couple functions and a lot of parentheses I was able to generate.....
sel (((current_date ( char(5) )) || '/01') (date)) (named firstofthismonth);
firstofthismonth
----------------
01/08/01
sel ((((current_date ( char(5) )) || '/01') (date)) + interval '1' MONTH) (named firstofnextmonth);
firstofnextmonth
----------------
01/09/01
sel (((current_date ( char(5) )) || '/01') (date)) (named firstofthismonth), (firstofthismonth + interval '1' MONTH) (named firstofnextmonth);
firstofthismonth firstofnextmonth
---------------- ----------------
01/08/01 01/09/01
Now how you put this mess into your CASE statement I don't know. This should even handles end of year roll overs correctly.
--