Posts

Showing posts from June, 2014

Get the total hours in HH:MM from 2 different time spans.

There was a specific requirement from one of our clients. The requirement was to get the total hours worked in HH:MM from 2 different time spans. The result has to be shown in SSRS.
The expecation was like below.

Day Hours Night Hour Total Hours Worked 12:30 27:49 40:19
After detailed research and combination, we had reached the below result.

= //Converting total Minutes to Hour Format( ( //Section 1 Getting Total Minutes of Start time in HH:MM ((Mid(ReportItems!Textbox14.Value, 0 + 1, (InStr(ReportItems!Textbox14.Value, ":") ) - 1) * 60) + Mid(ReportItems!Textbox14.Value, (InStr(ReportItems!Textbox14.Value, ":") ) + 1, LEN(ReportItems!Textbox14.Value) - 1))
//Summing Total Minutes of start and end time +
//Section 2 Getting Total Minutes of End time in HH:MM
((Mid(ReportItems!Textbox18.Value, 0 + 1, (InStr(ReportItems!Textbox18.Value, ":") ) - 1) * 60) + Mid(ReportItems!Textbox18.Value, (InStr(ReportItems!Textbox18.Value, ":") ) + 1, LEN(ReportItems!Textbox18.V…