Arc
May 8th, 2008, 10:52 PM
Hey guys, I was wondering if anyone had written a function that will return the number of work days between two dates. I figured this has been done many times, but I can't figure out how to go about it.
For instance if I put in the dates 2008-04-19 and 2008-05-02 it would return the number of days between those two dates minus weekends. Well not just between, it would also include those two days.
I was thinking of looping thru the dates somehow and using the date function to check if that date is a Sat or Sun using the Date("l") function, but I am not sure how to loop thru dates because you also have to know how many days are in the month and then start in the new month if the dates cross between two months...etc.
Anyone have any input? Thanks.
For instance if I put in the dates 2008-04-19 and 2008-05-02 it would return the number of days between those two dates minus weekends. Well not just between, it would also include those two days.
I was thinking of looping thru the dates somehow and using the date function to check if that date is a Sat or Sun using the Date("l") function, but I am not sure how to loop thru dates because you also have to know how many days are in the month and then start in the new month if the dates cross between two months...etc.
Anyone have any input? Thanks.