Discussion Locked

formula in VisualBasic

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How to count business hours within datarange in VisualBasic. I need very flexible formula becouse
I have to consider workhours, ordinary workdays (Mo-Fr or Mo-Sa or Mo-Su) and holidays.

Anyone could help, please?

Regards,
Kamil

7 replies

by john_wills

I don't find this question well enough defined to allow me to suggest any answer. I presume "datarange" means "date range", and I have done totalling over date ranges. Where are the business hours? in a table, on a form?

by prashant_bajaj

U can use the DateDiff function. It has the following syntax :
DateDiff(Interval As String, Date1, Date2)

Pass Interval as "hh" to calcute hours, and "mm" to calulate total time difference in minites.
Date1 and Date 2 should be the starting andending dates, please see do not forgoet to pass time with date, ie dont just pass the dates, add the time stamp also. I am sure this will help. Let me know if something is not clear, i will make a small smaple application here and forward it to you.

This discussion is closed to new replies.