Help Me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adem
    New Member
    • Nov 2006
    • 6

    #1

    Help Me

    I want to work Denomination for payroll with Access,
    i have data of employees with their salary, so what i want is how much of 100,50,20,10,5, & 1 dollar has one employee taking his salary inconsideration ,
    for example i salary X, is 120, so he has 1 of 100 , 0 of 50, 1 of 20,
    the result will be

    Name of employee Salary /100 /50 /20 /10 /5 /1
    Daniel 120 1 0 1 0 0 0
    Asmerom 50 0 1 0 0 0 0
    Jhone 231 2 0 1 1 0 1
    Total 401 3 1 2 1 0 1

    Thank u very much
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    Try this :-
    Code:
    Private Const conDenoms As String = "|0001|0005|0010|0020|0050|0100|0500|1000|"
    
    Public Function Denom(curWages As Currency, intDenom As Integer) As Integer
        Dim strWork As String
        Dim intIdx As Integer
    
        strWork = Format(intDenom, "\|0000\|")
        intIdx = InStr(1, conDenoms, strWork)
        Select Case intIdx
        Case 0
            Denom = 0
            Exit Function
        Case Is < Len(conDenoms) - 5
            curWages = curWages Mod Val(Mid(conDenoms, intIdx + 6, 4))
        End Select
        Denom = curWages \ intDenom
    End Function
    conDenoms should be changed if it doesn't reflect the denominations that you want.

    Comment

    Working...