0

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
Cœur
  • 37,241
  • 25
  • 195
  • 267
sraja
  • 1

1 Answers1

0

Have you tried:

DATEDIFF(day, date_start, date_end) - ((DATEDIFF(day, date_start, date_end) / 7) * 2)
Shyam Bhimani
  • 1,310
  • 1
  • 22
  • 37
Paul
  • 4,160
  • 3
  • 30
  • 56