I have also a problem with datediff
without week end, if you can help me:
i try to find days between two dates and it's give the right result when the dates are in same year, but when the date change the year it goes wrong:
my code is:
convert (float,datediff(dd,departureDate, min(arrivalDate)) -
(isnull((datepart(wk, min(arrivalDate)) -
datepart(week,Event2024_actual))*2,0))) as arrivalhome