![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am trying to get business days using datedif function. I get the difference in days, but do not know how to account for Saturday and Sunday. Can you help? |
#3
| |||
| |||
|
|
I presume you want to ask WHERE day is not Saturday or Sunday? The best way IMHO to handle this is to have a calendar table. CREATE TABLE CalendarTable ( DateID int IDENTITY(1,1) Primary Key, DateActual small datetime, DayOfMonth tinyint, MonthNum tinyint, YearNum tinyint, IsHoliday bit, IsWeekend bit etc ) You can therefore count the # of days between two dates where IsWeekend <> 0 and IsHoliday <> 0 In support of this method, do a search on Google for something like |
![]() |
| Thread Tools | |
| Display Modes | |
| |