Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify a DateDiff Query to Ignore Weekends?

Status
Not open for further replies.

mkallover

Programmer
Feb 6, 2008
88
0
0
US
Is there a way to modify this query to ignore weekends?

Code:
SELECT Req.request_id, Req.prcs_add_tmsp, MIN(Resp.response_date) AS FirstResponse, FORMAT(DateDiff("h", Req.prcs_add_tmsp, FirstResponse)/24,"00.000") AS ResponseTime
FROM dbo_CPO_REQUEST AS Req LEFT JOIN dbo_CPO_REQUEST_RESPONSE AS Resp ON Req.request_id = Resp.request_id
GROUP BY Req.request_id, Req.prcs_add_tmsp;
 
See faq181-261 as well as a number of other posts.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top