using datediffhours function I am getting 24 hours if i select the date for one day( from 1/17/2015 to 1/18/2015) want to change to 8 hours per day instead of 24 hours.
Solved! Go to Solution.
Apologies if I haven't understood you correctly but I understand you want to calculate the number of hours difference between two dates but you're treating each day as a "working day" e.g. 8 hours per day instead of 24. In that case, do you need to cater for weekends and public holidays too?
It seems the easiest solution is to continue to use dateDiffHours but divide the result by 3 to get an answer in multiples of 8 but if you have to cater for weekends etc then you'll need even more logic.
Hope that helps.
Depending on your needs it can be as simple as using Datediff in days, then multiply by 8.
This would mean however that only whole days will be calculated.
Then use something like
to handle those dates returning the working days only.