获取公司的当前所在账务期间的脚本

select com.fnumber,com.fname_l2,per.fnumber from T_BD_SystemStatusCtrol ssc 
left join  t_org_company  com on  ssc.fcompanyid=com.fid 
left join T_BD_Period per on ssc.FCurrentPeriodID =per.fid

 

获取每家公司的开账期间,以及对应的第一期

select org.fnumber,per.FPeriodYear ||'01' from T_BD_SystemStatusCtrol sysc 
left join  t_org_company  org  on sysc.FCompanyID=org.fid
left join T_BD_Period per on sysc.FStartPeriodID=per.fid 
where sysc.FIsStart=1 and org.FIsBizUnit=1 and org.FIsSealUp=0
and org.fnumber not like '0106%'and org.fnumber not in ('0601') 
and FSystemStatusID in ('e45c1988-00fd-1000-e000-33d8c0a8100d02A5514C')
and per.fnumber not like '%01'

你可能感兴趣的:(金蝶EAS,BOS常用sql语句)