qinghe 发表于:2020-11-13 00:02:08
因为工作内容的关系,需要把工资按照对应的货币面值进行分配,设计了一个数据查询界面,不知道错误在哪里,希望能够得到大家的指点。
点击下载此附件
校验的控件来源有错误,少统计了R2K的
这里,先谢谢您的指导!
请原谅,我可能提错了问题。
我其实想得到的结果是这样的:
以167.99为例
计算的结果是
100=1
50=1
10=1
5=1
2.5=1
0.25=1
0.125=1
0.025=4
我想得到的分配结果是
100=1
50=1
10=1
5=1
1.25=1
0.5=1
瞎琢磨了一个,希望各位老师指点一下更好的办法,谢谢!
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.U100 = Int(round([应发],1)/100);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.U50 = Int((round([应发],1)-U100*100)/50);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.U20 = int((round([应发],1)-U100*100-U50*50)/20);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.U10 = Int((round([应发],1)-U100*100-U50*50-U20*20)/10);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.R2W = Int((round([应发],1)-U100*100-U50*50-U20*20-U10*10)/5);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.R1W = Int((round([应发],1)-U100*100-U50*50-U20*20-U10*10-R2W*5)/2.5);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.R5K = Int((round([应发],1)-U100*100-U50*50-U20*20-U10*10-R2W*5-R1W*2.5)/1.25)"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.R2K = Int((round([应发],1)-U100*100-U50*50-U20*20-U10*10-R2W*5-R1W*2.5-R5K*1.25)/0.5);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.R1K =Int((round([应发],1)-U100*100-U50*50-U20*20-U10*10-R2W*5-R1W*2.5-R5K*1.25-R2K*0.5)/0.25);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.Hu5 = Int((round([应发],1)-U100*100-U50*50-U20*20-U10*10-R2W*5-R1W*2.5-R5K*1.25-R2K*0.5-R1K*0.25)/0.125);"
DoCmd.RunSQL "UPDATE S_Plan SET S_Plan.Hu1 = 100*int(40*([应发]-U100*100-U50*50-U20*20-U10*10-R2W*5-R1W*2.5-R5K*1.25-R2K*0.5-R1K*0.25-Hu5*0.125)+0.5)/100;"
想得到的结果和计算结果又什么关系?或者说是什么规则?
总记录:4篇 页次:1/1 9 1 :