Solved

Calculate Vacation time

Posted on 2002-04-26
7
294 Views
Last Modified: 2013-12-18
Hello,

 I need to be able to calculate vaction time in hours and quarter hours - holidays - weekends  and taking in to account a maxium total of 8 hours per day with my result rounded to the nearest quarter hour

So an entry of StartDate 04/26/2002 Starttime 08:00
               EndDate   04/29/2002 Endtime 12:30

Would result in 12.5 hours.

I am currently calling holidays like this
 'Get the list of Holidays
          Set hookview = db.GetView("Holidays")
          Set hookdoc = hookview.GetDocumentByKey("Holidays",True)

   

0
Comment
Question by:kplew
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6971506
Zvonko !!!
This is yours buddy!  I hate time calculations...
:-)
Arun.
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 100 total points
ID: 6972295
Here is a prototype for you,

sTime := [8:00 AM];
eTime := [5:00 PM];
StartDate := [04/26/2002 08:00:00];
EndDate := [04/30/2002 12:30:00];
@if( StartDate > EndDate; @Return(0); "" );

diffDays := @integer((EndDate - StartDate) / 86400) + 1;
strtDay := @Modulo(@Weekday(StartDate); 7);
endDay := @Modulo(@Weekday(EndDate); 7);
days := (diffDays - endDay + strtDay - 8) * 5 / 7 - @Max(-2; -strtDay) - @Min(1; endDay) + 5 - strtDay + endDay;
sTimeD := @Time(eTime) - @time(StartDate);
eTimeD := @Time(EndDate) - @time(sTime);
sTimeDiff := @if( sTimeD < 0; 0; sTimeD)/3600;
eTimeDiff := @if( eTimeD < 0; 0; eTimeD/3600);

total :=  (days-1) * 8 + eTimeDiff ;

@Prompt([OK]; "Total vacation hours" ;  @Text(total) )

~Hemanth
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6976489
Nice Hemanth,
but what about holidays ?

I would do this using LotusScript.

kplew,
Are the holidays registered in the Domino Directory ? (I'm supposing you're using R5).

If so, I can write a script to do the calculations for you. If not, you need to keep the holidays somewhere else and get them from there. Let me know how and where you keep the holidays for your company and I will write the script for you.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6986131
Any progress ?
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6988020
None, I suppose :-)
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10859820
kplew,
No comment has been added to this question in more than 717 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

RECOMMENDATION: Award points to HemanthaKumar http:#6972295

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Zvonko
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question