1. 程式人生 > >Sql使用查詢某一天的發生憑證

Sql使用查詢某一天的發生憑證



select * from t_gl_voucher v 
left join  t_org_company c on c.fid=v.fcompanyid
left join  T_BD_Period p on v.FPeriodID=p.fid
left join T_PM_User u on u.fid=v.FCreatorID 
where c.fnumber in (
'T00230001','T07730008') 
and p.FPeriodYear=2016 and p.FPeriodNumber=12
and u.fnumber in ('user')
and to_char( fbizdate,'yyyy-mm-dd')='2016-12-25'

order by v.FCreateTime  desc;

select to_char(sysdate,'YYYY-MM-DD') from dual;