How to join an existing table that has starting date and closing date to the existing calendar table to calculate working days .
My calendar table looks like this :-
dt isweekday isholiday Y FY Q M D DW monthname dayname W
1/1/2010 0:00 FALSE FALSE 2010 2010 1 1 1 6 January Friday 1
1/2/2010 0:00 FALSE FALSE 2010 2010 1 1 2 7 January Saturday 1
1/3/2010 0:00 TRUE FALSE 2010 2010 1 1 3 1 January Sunday 2
1/4/2010 0:00 TRUE FALSE 2010 2010 1 1 4 2 January Monday 2
1/5/2010 0:00 TRUE FALSE 2010 2010 1 1 5 3 January Tuesday 2
1/6/2010 0:00 TRUE FALSE 2010 2010 1 1 6 4 January Wednesday 2
and the other table containing start date and end date looks like the following :-
orderid orderdate ordercloseddate actionby
40978 4/15/2010 12:47 4/18/2010 14:47 tjjohn
Aucun commentaire:
Enregistrer un commentaire