I have the following
select
cast(substr(date,1,8)||'01' as date format 'yyyy-mm-dd') as FirstDay,
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 LastDay,
cast(substr(add_months(date,-1),1,8)||'01' as date format 'yyyy-mm-dd') FirstDayLM
Need one more to determine the last day of the last month, any ideas?
Thanks Much
select
cast(substr(date,1,8)||'01' as date format 'yyyy-mm-dd') as FirstDay,
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 LastDay,
cast(substr(add_months(date,-1),1,8)||'01' as date format 'yyyy-mm-dd') FirstDayLM
Need one more to determine the last day of the last month, any ideas?
Thanks Much