问题描述
select'003'aszhangtao,convert(varchar(10),dbill_date,120)dbill_date,g.ccode,c.ccode_name,g.csign,g.ino_id,g.cdigest,g.ccode_equal,g.cdept_id,b.cDepName,g.cperson_id,p.cPersonName,g.ccus_id,cu.cCusName,g.csup_id,v.cVenName,g.citem_class,f.citem_name,g.citem_id,ct.citemname,mdasjiefang,mcasdaifang,convert(varchar(20),cast(md_fasmoney),1)md_f,convert(varchar(20),cast(mc_fasmoney),1)mc_f,ex.cexch_name,g.nfrat,ex.idec,g.nd_s,g.nc_s,fangxiang=casec.bpropertywhen'0'then'贷'when'1'then'借'end,yuer=casec.bpropertywhen'0'thenmc-mdwhen'1'thenmd-mcendfromGL_accvouchgleftjoincodecong.ccode=c.ccodeleftjoinDepartmentbong.cdept_id=b.cDepCodeleftjoinPersonponp.cPersonCode=g.cperson_idleftjoinCustomercuoncu.cCusCode=g.ccus_idleftjoinVendorvonv.cVenCode=g.csup_idleftjoinfitemfonf.citem_class=g.citem_classleftjoinfitemss98ctong.citem_id=ct.citemcodeleftjoinforeigncurrencyexonex.cexch_name=g.cexch_namewhere1=1andg.iflagisnullandiperiod!=0anddatepart(year,dbill_date)*100+datepart(month,dbill_date)>=200701anddatepart(year,dbill_date)*100+datepart(month,dbill_date)<=200712orderbyg.ccodeasc
解决方案
解决方案二:
那么长看不懂算了