|
2#
楼主 |
发表于 2024-1-12 14:16:28
|
只看该作者
原句中的代码,上面是变量替换后的结果
strsql1 = "select lsbb.员工编号,lsbb.员工姓名,lsbb.员工性质,lsbb.员工类别,lsbb.工作单位,lsbb.职务,lsbb.工资关系单位,lsbb.法人简称,lsbb.本月工资,lsbb.本月奖金,lsbb.本月不计税收入,rounda(lsbb.养老比例*lsbb.养老基数,2) as 养老单位,"
strsql2 = "iif(lsbb.法人简称='服装厂',iif(" & SRGZZE(5) & ">" & YLJSHJ(5) & ",Rounda(lsbb.上月计税收入*" & SRGZZE(5) & "*lsbb.医疗比例/" & ZZSRGZZE(5) & ",2),rounda(lsbb.医疗比例*lsbb.医疗基数,2)),iif(lsbb.法人简称 like '*油田*',rounda(lsbb.医疗比例*lsbb.医疗基数,2),"
strsql3 = "iif(lsbb.法人简称='广源',iif(" & YLJSHJ(3) & "<" & syyljs & "*" & YLRS(3) & ",rounda(" & syyljs & "*lsbb.医疗比例,2),rounda(lsbb.医疗基数*lsbb.医疗比例,2)),iif(lsbb.法人简称='油隆',iif(" & YLJSHJ(4) & "<" & syyljs & "*" & YLRS(4) & ",rounda(" & syyljs & "*lsbb.医疗比例,2),rounda(lsbb.医疗基数*lsbb.医疗比例,2)),"
strsql4 = "iif(lsbb.法人简称='天衣隆',iif(" & YLJSHJ(6) & "<" & syyljs & "*" & YLRS(6) & ",rounda(" & syyljs & "*lsbb.医疗比例,2),rounda(lsbb.医疗基数*lsbb.医疗基数.2)),iif(lsbb.法人简称='加油站',iif(" & YLJSHJ(7) & "<" & syyljs & "*" & YLRS(7) & ",rounda(" & syyljs & "*lsbb.医疗比例,2),rounda(lsbb.医疗基数*lsbb.医疗比例,2)),rounda(lsbb.医疗比例*lsbb.医疗基数,2))))))) as 医疗单位,"
strsql5 = "iif(lsbb.高额医疗=66,66,iif(lsbb.高额医疗=50,50,0)) as 高额单位,iif(lsbb.法人简称='服装厂',iif(mid('" + getyf() + "',6,4)='一月',260,0),0) as 补充医疗,rounda(lsbb.工伤比例*lsbb.养老基数,2) as 工伤单位,iif(lsbb.法人简称='服装厂',8,0) as 补充工伤,rounda(lsbb.失业比例*lsbb.失业基数,2) as 失业单位,rounda(lsbb.公积金比例*lsbb.公积金基数,0) as 公积金单位,iif(lsbb.员工类别='合同化员工',rounda(" & hthNJDW & "*lsbb.企业年金/" & hthNJZE & ",2),rounda(" & schNJDW & "*lsbb.企业年金/" & schNJZE & ",2)) as 年金单位,lsbb.其他比例 into lsba from lsbb"
strsql = strsql1 + strsql2 + strsql3 + strsql4 + strsql5 |
|