Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculate hours 1

Status
Not open for further replies.

koune

Programmer
Oct 1, 2001
7
0
0
NL
Hi all,

I have to calculate the number of minutes between two dates (dd/mm/yyyy hh:mm). Datediff isn't available because I can only use Business Objects and DayNumberOfYear won't help because then the result is 0 when the two dates are for example "23-10-2001 13:34" and "23-10-2001 15:54". Then I want 140 as a result and not 0.

Thanks,
Koen
 
Hi

You need a add a variable through VBA script.
There is a function called daydiff in VBA, (pass the paramter h for hour, m for minute, as interval)

Shyam
 
Thanks Shyam,

But can you also tell me how to call the VBA-script when a user opens the report?


And can I ask you one more question ('cause I think you have fairly more knowledge of BO):


I need to calculate within working hours, maybe it's better to use an example...

Suppose I want to calculate the number of minutes between the moment and call you and the
moment you call me back (helpdesk). But I only want to add the minutes of the working days, so:

Workingdays are: Mon-Fri 08:30 - 17:00
I call you: thursday 04-oct-2001 at 09h30
You call me back: monday 08-oct-2001 at 11h15.

Then the number of minutes before you respond is:
thursday: 17:00 minus 09:30 --> 7,5x60 = 450
friday: 17:00 minus 08:30 --> 8,5x60 = 510
monday: 11:15 minus 08:30 --> 2.75x60 = 165

Total = 450+510+165 = 1125

Hope you can help me.

With Regards,
KOEN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top