sql两个日期间剔除周末的间隔时间

 (TRUNC(EndTime) - TRUNC(StartTime) ) +
  (CASE WHEN TO_CHAR(StartTime,'DY','nls_date_language=english') in ('SUN','SAT') THEN 1 ELSE 0 END) - 
  ((((TRUNC(EndTime,'D'))-(TRUNC(StartTime,'D')))/7)*2 ) -
  (CASE WHEN TO_CHAR(StartTime,'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) -
  (CASE WHEN TO_CHAR(EndTime,'DY','nls_date_language=english')='SAT' THEN 1 ELSE 0 END) BusinessDays

你可能感兴趣的:(other)