分享到:
发表于 2013-10-15 11:16:31 楼主 | |
SELECT b.fname,case when c.FSupplyID=2518 then d.FAuxQty else 0 end '赊销金额', case when c.FSupplyID=2518 then d.FDiscountAmount else 0 end '赊销折扣', case when c.FSupplyID=2518 then d.FConsignAmount else 0 end '赊销净额', case when c.FSupplyID=3321 then d.FAuxQty else 0 end '现销金额', case when c.FSupplyID=3321 then d.FDiscountAmount else 0 end '现销折扣', case when c.FSupplyID=3321 then d.FConsignAmount else 0 end '现销净额', d.FAuxQty*FConsignPrice as '总金额', d.FDiscountAmount as '总折扣', d.FConsignAmount as '总净额', c.fdate as '日期' from [AIS20130930153452].[dbo].[t_ICItembbse] a inner join [AIS20130930153452].[dbo].[t_item] b on a.FItemID=b.FItemID left join [AIS20130930153452].[dbo].[ICStockBill] c on a.FItemID=c.finterid left join [AIS20130930153452].[dbo].[ICStockBillEntry] d on d.FInterID=c.FInterID where b.FItemClassID=4 AND c.FTranType=21 这是查询语句 和 结果图,,,如果赊销和现销同时存在,要一起显示 后面的总额等要汇总赊销现销,怎么改。。。有能力你就放马过来吧 ![]() |
|
楼主热贴
个性签名:无
|
针对ZOL星空(中国)您有任何使用问题和建议 您可以 联系星空(中国)管理员 、 查看帮助 或 给我提意见