This is an archived course — no longer updated. Instead, we’re building a community that helps Sage, Infor, and NetSuite users move to iDempiere open source ERP — do more, move faster, at 1/10th the cost. Read the full story →

Update Period Name with YYYY-MM Formatting

--begin;
 update c_period x
 set name = concat_ws('-',y.fiscalyear,lpad(p.periodno::text,2,'0'))
 from c_period p
 join c_year y on p.c_year_id = y.c_year_id
 where y.ad_client_id = 1000000
 and x.c_period_id = p.c_period_id
 ;