关于在学校工作的sql server企业进程 [英] About sql server enterprise process which is working in a school
问题描述
我有疑问:
在SQL Server企业版中。
我必须做一个工资单流程中的程序。它是面额
例如:如果工资是1000,那么货币将由500 100 50 10 5 1组成,请给我一个这个程序结构的提示或代码片段应该是表格形式。
SHOUTING删除 - OriginalGriff [/ edit]
I am in doubt :
IN SQL Server Enterprise .
i have to do a program which is in payroll process. it is denomination
for eg: if a salary is 1000 there will be currency consist of 500 100 50 10 5 1 please give me a hint or code snippet for this program structure and it should be in tabular form.
[edit]SHOUTING removed - OriginalGriff[/edit]
推荐答案
首先,您需要确定您有多少面额,以及您有多少种面额? ?
例如:500卢比可分为单个500卢比纸币,5卢比纸币,50个十卢比纸币等。
如果您知道wat将是面额的数量,那么您可以将它们作为常量存储在程序中,然后编写一个查询来划分金额。
ex:
Hi,
First you need to decide how many denominations do you wana have and how many kinds of denominations do you wana have?
For ex: a 500 rupee can be divided into a single 500 rupee note, 5 hundred rupee notes, 50 ten rupee notes and so on.
If you know wat will be the number of denominations then you can have them as constants in your stored procedure and then write a query which will divide the amount.
ex:
create table tblDenominations(
Numberof500 int,
Numberof100 int,
Numberof50 int,
Numberof10 int,
Numberof5 int,
Numberof1 int)
对于一个场景,让我们插入一行。
For a scenario, let us insert a row.
Insert into dbo.tblDenominations values(5,2,4,5,9,5)
现在如果你想分数3000,然后你可以有
5 * Numberof500 + 2 * Numberof100 + 4 * Numberof50 + 5 * Numberof10 + 9 * Numberof5 + 5 * Numberof1
Ho你可以从上面的场景中得到一些想法。
问候
anurag
Now if you want to divide a amount say 3000, then you can have as
5*Numberof500 + 2*Numberof100 + 4*Numberof50 + 5*Numberof10 +9*Numberof5 +5*Numberof1
Hope you get some idea from the above scenario.
Regards
anurag
假设你的工资单
表格是这样的
suppose yourpayroll
table is like this
TransId EMP_NO PAID_AMT PAID_DATE
------------------------------------
1 1 10000 20-02-1013
创建另一个表 NoteDetails
create another table NoteDetails
TransId NoteValue NoOfNotes
----------------------------------------------
1 500 18 500 * 18 = 9000
1 100 10 100 * 10 = 1000
1 50 20 50 * 20 = 1000
------------------
10000
快乐编码!
:)
Happy Coding!
:)
这篇关于关于在学校工作的sql server企业进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!