Former Member

# Payroll and Query

Hello All

1. Need to query Number of Years of service,Number of active days in Month,Year (Deducting Inactive days) in payroll to make payment of a wage type, how to query?

2.We have a payment of Other allowance as Rs.1000 but for this Jan2016 alone we need to pay 10% extra for an employee group & Subgroup differently, how to do it (From February onward it will be RS.1000 again for the same EG&ESG combinations).

Reg

SK

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Jan 18, 2016 at 05:20 AM

hi s.k

what i understood is u want to get the Number of Years of service and Number of active days in a year..

is that right?

10|10000 characters needed characters exceeded
• Former Member

hi s k

if u want to know the Number of Years of service:

u can try this code

integer li_totalyears

long ll_startyear,ll_endyear

date ld_startdate =date ("2016/ 1/1")

date ld_enddate = Date( "2020/1/18")

ll_startyear = year(ld_startdate)

ll_endyear = year(ld_enddate)

li_totalyears=ll_endyear - ll_startyear

happy coding!

best regards,

Delna Domini

• Former Member
Posted on Jan 18, 2016 at 05:41 AM

hi sk...

next u want to know the total number of days in a particular month of year, right?

date ld_Date = Date( "2016/1/18" )

Integer li_days[12]={31,28,31,30,31,30,31,31,30,31,30,31}

Integer li_month, li_year,li_daysinmonth

li_month =month(ld_Date)

li_year = year(ld_Date)

li_daysinmonth = li_days[li_month] // --Leap year or not

If li_month=2 Then

If ( (Mod(li_year,4) = 0 And Mod(li_year,100) <> 0) Or (Mod(li_year,400) = 0) ) Then

li_daysinmonth = 29

End If

End If

The above code will give u the total number of days in a month and then u can deduct inactive days from li_daysinmonth

Happy coding!

Best regards,

Delna Domini