I would like to build an SQL query which calculates the difference between 2 dates, without counting the week-end days in the result.
Is there any way to format the
You can try this:
SELECT Id, DATEDIFF(d, datefrom, dateto) AS TotDays, DATEDIFF(wk, datefrom, dateto) AS Wkds, DATEDIFF(d, datefrom, dateto) - DATEDIFF(wk, datefrom, dateto) AS Days FROM YOURTABLE