i have this table
customer sunday monday tuesday wedesneday thursday friday saturday
1 0 0 1 1 1 0 0
2 0 1 0 0 0 0 1
3 0 0 1 0 1 0 1
4 0 0 1 1 0 1 0
5 0 1 0 0 1 1 1
6 0 0 1 0 1 1 0
7 0 1 0 1 1 0 1
8 0 0 0 0 1 1 0
9 0 1 1 1 0 0 1
now i have next parameter> year and months january, february, march(or any user chooses) how scheduled visits are going to have by month?
Note: for every month no precisely start with sunday or finish with saturday, and monts doesn't have the same quantities days.
I believe i could get the first day and last day for every month choosed by user
with a loop and a select using datepart > datepart(weekday,'1/'+(some month)+'\'+year_choosed_by_user)
I believe i could get something as it
month, startday, lastday, days
1 0 2 31
2 3 3 29
3 4 6 30
where 0=sunday and 6=saturday, could it help? i'll get this #tmptable using datepart