PC Review


Reply
Thread Tools Rate Thread

calculating vacation

 
 
=?Utf-8?B?Q2xheW1hbg==?=
Guest
Posts: n/a
 
      26th Jul 2007
This is killing me. I'm developing a vacation-tracking system, and I need to
calculate vacation based on anniversary date. Everything over 1 year is easy
(Select Case). But less than a year it gets tricky.

If they've been here less than six months, they accrue no vacation.

They start accruing at a rate of 1.54 hours per pay period beginning at 180
days, and can use vacation in advance - so we need to know the amount of
vacation available through the end of the year.
(Day(Now)-Day(HireDate)/7*1.54?)

But if their 6-month-anniversary was before January 1, then they accrue at
the normal rate.

And vacation does not carry over from year to year.

Thanks in advance.
--
Adios,
Clay Harryman
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2xheW1hbg==?=
Guest
Posts: n/a
 
      26th Jul 2007
OK - I'm still building the code so I can test this, but here's what I've got
so far:

Select Case anniv
Case Is < 2
LAccrualRate = 1.54
' Calculate day of last day of hire year
DtEndOfYear = CDate("12/31/" & CStr(Year(hiredate)))
LCountDays = Day(DtEndOfYear) - Day(hiredate)
' Check to see if 180 days elapsed between hiredate and end of hire year
If LCountDays > 180 Then
' if so, was employee hired last year?
If Year(hiredate) < Year(Now) Then
' if so, hours accrued = 80
LHoursRemain = 80
Else
' if not, hours accrued = weeks * 1.54
LWeeksWorked = LCountDays / 7
LHoursRemain = LWeeksWorked * 1.54
End If
Else
' if 180 days not elapsed, hours accrued=0
LHoursRemain = 0
End If
Case 2 To 4
LHoursRemain = 80
LAccrualRate = 1.54
Case 5 To 14
LHoursRemain = 120
LAccrualRate = 2.31
Case Is > 14
LHoursRemain = 160
LAccrualRate = 3.08
End Select
--
Adios,
Clay Harryman


"Clayman" wrote:

> This is killing me. I'm developing a vacation-tracking system, and I need to
> calculate vacation based on anniversary date. Everything over 1 year is easy
> (Select Case). But less than a year it gets tricky.
>
> If they've been here less than six months, they accrue no vacation.
>
> They start accruing at a rate of 1.54 hours per pay period beginning at 180
> days, and can use vacation in advance - so we need to know the amount of
> vacation available through the end of the year.
> (Day(Now)-Day(HireDate)/7*1.54?)
>
> But if their 6-month-anniversary was before January 1, then they accrue at
> the normal rate.
>
> And vacation does not carry over from year to year.
>
> Thanks in advance.
> --
> Adios,
> Clay Harryman

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Need Formula for Calculating Accrued Vacation Time Mike H Microsoft Excel Worksheet Functions 0 26th Dec 2008 08:15 PM
Calculating Vacation Time by Month =?Utf-8?B?U3RldmU=?= Microsoft Excel Misc 0 5th Jul 2007 03:30 PM
Calculating Vacation Time =?Utf-8?B?Sm9hbm5l?= Microsoft Access Queries 2 30th Dec 2006 02:55 AM
calculating accumulated vacation time rpiescik Microsoft Excel Worksheet Functions 5 13th Sep 2004 03:26 PM
Calculating vacation accrual Strike! Microsoft Excel Worksheet Functions 10 27th Aug 2004 01:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:56 AM.