数据库

本类阅读TOP10

·SQL语句导入导出大全
·SQL Server日期计算
·SQL语句导入导出大全
·SQL to Excel 的应用
·Oracle中password file的作用及说明
·MS SQLServer OLEDB分布式事务无法启动的一般解决方案
·sqlserver2000数据库置疑的解决方法
·一个比较实用的大数据量分页存储过程
·如何在正运行 SQL Server 7.0 的服务器之间传输登录和密码
·SQL中两台服务器间使用连接服务器

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
通用工资计税方案

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

--1:计税方案表
create table  skm_mstr(序号 int,工资比例 int,始 int, 止 int,税率 int,速算值 int )
/*
以下数据为深圳龙岗台资企业计税方式:
(比如工资为4000的计税方式为:4000*87/100 = 3840, 在2100-3599之间,适用于第3条
则计算公式为 (4000*87/100-2100)*10/100 + 25 = 163  )
*/
insert skm_mstr select  1,    87    ,0   ,  1599 , 0 ,0
union all select     2 ,   87   , 1600,  2099 , 5 ,0
union all select     3  ,  87  ,  2100,  3599 , 10 ,25
union all select     4   , 87 ,   3600,  6599 , 15 ,175
union all select     5    ,87,    6600,  99999, 20 ,625
go

--2:自定义函数计税
create function test(@a numeric(10,2))
returns numeric(10,2)
As
begin
declare @b numeric(10,2)
select @b = ( @a * 工资比例/100 - 始) * 税率 / 100 + 速算值 
from skm_mstr  
where floor(@a * 工资比例/100) between 始 and 止
return @b
end 
go

--3:调用
Select dbo.test(4000)  -- 计算工资额为4000时的税款。
/*显示结果为
------------
163.00

(所影响的行数为 1 行)
*/




相关文章

相关软件