Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Counting business or working day minutes

$
0
0

Hi

I have a piece of SQL which works out hours and minutes between two dates:

CONVERT(VARCHAR(10), DATEDIFF(MINUTE, D.RepairInstructed, A.EstimateReceived) / 60) + '.' +
CASE
	WHEN LEN(DATEDIFF(MINUTE, D.RepairInstructed, A.EstimateReceived) % 60) = 1 THEN '0' + CONVERT(VARCHAR(10), DATEDIFF(MINUTE, D.RepairInstructed, A.EstimateReceived) % 60)
	ELSE CONVERT(VARCHAR(10), DATEDIFF(MINUTE, D.RepairInstructed, A.EstimateReceived) % 60)
END AS 'EstimateRecievedTime'

What I would like to do is do the same calculation but omit the weekends - so only to include Monday to Friday.

Any idea on how to do this please?

Thanks.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>