|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
不修改数据源,只通过SQL引入外部查询。语句如下:
select 产品类型,费用项,实收费用 as 收款金额,0 as 退款金额,iif(left(产品号码,1)="3","固话",iif(left(产品号码,1)="8","小灵通",iif(left(产品号码,3)="104","宽带",iif((left(产品号码,3)="133" or left(产品号码,3)="153" or left(产品号码,3)="189"),"手机","其他")))) as 分类 from [sheet1$a1:i869] where 实收费用>0 union all
select 产品类型,费用项,0,实收费用 as 退款金额,iif(left(产品号码,1)="3","固话",iif(left(产品号码,1)="8","小灵通",iif(left(产品号码,3)="104","宽带",iif((left(产品号码,3)="133" or left(产品号码,3)="153" or left(产品号码,3)="189"),"手机","其他")))) as 分类 from [sheet1$a1:i869] where 实收费用<0
[ 本帖最后由 抹香鲸2009 于 2010-5-6 08:35 编辑 ] |
|