.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
Post New Web Links

How to calculate total work hours between dates?

Posted By:      Posted Date: November 04, 2010    Points: 0   Category :SharePoint
 
I am in the process of creating a calendar.  This calendar is to track leave hours for employees.  For example if a person takes leave for 2.5 days then the formula would calculate 8hrs per day and 4 hours for half a day = 20hrs.  I have part of the formula I believe "=TEXT([End Time]-[Start Time],"h")".  The problem is that it does not count multiple days and just not working right. Any advice would help.
Qjm


View Complete Post


More Related Resource Links

How to calculate working hours betwwen two dates?

  

Working days - Mon-Fri and Working hours - 9 Am to 5 Pm

Date1                                       Date2                                                Working Hours

Thur, 14-Oct-10 11.30 Am          Thur, 14-Oct-10 5.00 Am                     5.30

Fri,  15-Oct-10 11.30 Am            Mon, 18-Oct-10 5.00 Am                      13.30

Mon,  18-Oct-10 11.30 Am          Mon, 18-Oct-10 6.00 Am                      5.30

 


Thanks & Regards, PSWA

Logic to calculate business hours

  

Hi All,

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.

I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.

 

Please help me guys... It will be a great help... 


calculate business day between two dates

  
Hi Guys   I need the count of business days between two  dates Date1, Date2 i need the count only business day (exclude sartuday&sunday) If date1 is null or nothing i need to pass 0 If date2 is null or nothing i need to pass 0   help on this

Looking for .net people in the USA to talk to on Live Messenger during work hours... talk code.. ide

  
Im not sure this is the right place to ask but ill give it a try. If theres a better place for this someone let me know please anyways. I am a .NET dev and would love to have a couple people int/adv level .net devs I could IM a question regarding .NET things I am working on.. not 'do this for me please!' questions but Id want to ask more general ways to go about doing things and just conversation fun talk about coding ideas .. I am the only dev at work so it is lonely not having anyone I can ask questions to.. so if anyone would like to chat add me on Live messenger (punkouter@hotmail.com)

MOSS 2007 Calculate Due Date including working hours and working days

  
Hi, I've searched many forums for an answer to my problem but with very limited success. Basically, I've created a Sharepoint list where I would like to track a resolution of incidents versus SLA timings. I have a column with a receiving date, which is a date when the request was submitted and another column with priority code where I have 3 possible values: low (5 working days to close the request), medium (3 days) and high (1 day). What I would like to do is to automatically calculate due date for solving the incident based on the receiving date and the priority code. The thing is that now it is getting more complicated since I need to exclude saturdays and sundays from calculation, as well as national holidays. Then I would like to take into account working hours (from 8am to 4pm), for example if an incident with medium priority was submitted on Friday 5pm, then it would have its due date set to Wednesday 4pm (the request was sent after working hours so we have 3 full working days to complete it) Not sure if it is feasible to achieve using formulas, maybe some other way?

How do i calculate no of days between two given dates

  
Dear All, My requirement is used to find no of days between two given dates and time(from date and to date). using c#. Thanx in advance Dinesh        

How can I calculate the Number of Weekends between two dates

  
I need to be able to figure out the number of Saturdays and the number of Sundays between two dates.  I know that I can do this by looping through the series of dates between the start date and end date.  Years ago I saw a piece of code that an ex-co worker wrote that accomplished this task using a formula.  The formula was extemely effecient.  Unfortunately I no longer have access to this code.  Does anyone have an algorithm that will perform this calculation that I can make use of?  Thanks

How do i calculate no of days between two dates n two times Using C#

  
Dear All, i got the task to find no of days between two dates n Two given times Using C# I have four fields( columns) Such as follows, Arrival Date, Arrival Time, Leaving Date and Leavingtime. Example: Leaving Date-24/08/2010,Leaving Time- 08:00 , Arrival Date- 12/09/2010 ,Arrival Time-16:00, From the above Example i need to find No of days. Note : Days should calculate from Leaving time to arrival time (with reference to above example it means if he starting at 8:00 o clock(24/08/2010)  in the morning the next day eight o clock will be one day(8:00/ 25/08/2010)) Thanx in advance    

How can I calculate the Number of days between two dates Monday to Friday

  

    I am using following code for Robert's Posted Code (Url:http://forums.asp.net/t/1142378.aspx) But this is for only calculate weekends saturday and sunday can any one tell me how 
I get Number of days between given two dates Monday to Friday.



private const int MONDAY = 1; private const int TUESDAY = 2; private const int WEDNESDAY = 3; private const int THURSDAY = 4; private const int FRIDAY = 5; private const int SATURDAY = 6; private const int SUNDAY = 7; /// <summary> /// Observe that the method calculates by including the start day, but excludes the end day /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> private void GetWeekendDaysBetween(DateTime startDate, DateTime endDate,out int saturdays,out int sundays) { saturdays = -1; sundays = -1; if (endDate < startDate) return; TimeSpan timeBetween = endDate.Subtract(startDate); int weekendsBetween = timeBetween.Days / 7; sundays =

Get Difference between two dates as Hours, Minutes

  

Hi,

 I am using the below query to get difference beiween two dates in hours and minutes.Minutes part look ok but the hours is incorrect.

 select datediff(minute,LastDate,getdate()) as "Minutes", datediff(hour,LastDate,getdate()) as "Hours"from emp.

 Note: Using SQL Server 2005


Regards
Janet


How to calculate the hours?

  

Hi,


How would you calculate the hours?

Example:
05:00 15:00 = 10 hours
07:00 12:00 = 5 hours

12:15 to 14:30 = 2 hours 15 minutes.


Regards.


How to Get Total Minutes From Hours in SQL Server 2005?

  

Hi All.........!

I have 10:45 Hours and Now I want to get Total Minutes Like 645 Minutes.

How Can I Get in SQL Server 2005?

Please Help Me................!

Thanks in Advanced..............!


How to calculate difference between two dates in years

  

hi all, 

i need to know if, given a birth date, a person has more than x years. Thats mean, the client must entry a date in a textbox and i need to know if the persona has more than 18 years. 


Thx in advance


How to Define a "Total" to Calculate Percentage for SKU in PivotTable?

  

Let's take a look at a sample PivotTable below:

 

SKU     $     NewMeasure

111     5      30 (5+ 10 + 15)

222     10     30 (5+ 10 + 15) 

333     15     30 (5+ 10 + 15)


SKU     $     NewMeasure

111     5      20 (5+ 15)

333     15     20 (5+ 15)

 

How do I go about defining the "NewMeasure" calculated member in my AS2008 Enterprise cube?  The NewMeasure should essentially be the total $ amount for all SKUs in the current PivotTable.

What I'm really after, in this particular example, would be the percentage of a given SKU's $ amount relative to the total $ amount for all SKUs in the current pivot.  I figured if I can get the "NewMeasure" logic figured out, the above would be easy.


In summary, my goal is:

SKU     $     NewMeasure         NewMeasure2

111     5      30 (5+ 10 + 15)    5/30

222 

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend