Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Count the Number of Weekend Days between Two Dates

    One more option:

    select
        [WeekendDays]=
            ceiling(datediff(day,dateadd(d,        (7-datepart(weekday,@start)),            @start),@end)/7.0)+                --count saturdays starting at the first saturday
            ceiling(datediff(day,dateadd(d,        (8-(datepart(weekday,@start)))%7,        @start),@end)/7.0)                --count sundays starting at the first sunday

Viewing post 1 (of 1 total)