I need to calculate the difference of two dates, not including Sat. and Sun. Is there a formula that I can use for this? or what is the best way to solve this problem?
Or If You Like Do While Loops
*
[tt]
*procedure WeekDays
lparameter pdStart, pdEnding
lnDays = pdEnding - pdStart
do while pdStart < pdEnding
pdStart=pdStart+1
if between(dow(pdStart),2,6)
lnDays=lnDays+1
endif
enddo
return lnDays
[/tt]
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
I found a VB function in the access forum that does this. It is not pretty but it does also handle holidays. I rewrote it (w/ authors permission) in VFP and posted as an FAQ. It does more than you need, but it is pretty neat none the less.
Pete
blindpete@mail.com
What your mother told you is true! You will go blind! (from moonshine anyway)
I read your functions. The philosophy is slightly different from the one I re-coded. The VB one interates the floating holidays. For instance Thanksgiving it counts the 4th Thurs in Nov. I am no calander guro... I have no idea how these things are actually defined. It would seem to me that both methods are likely required for a bolier plate function.
Pete
blindpete@mail.com
What your mother told you is true! You will go blind! (from moonshine anyway)
logout151, Pete,
I got bored at work yesterday and figured it was not fair to the other users of this forum that we just posted U.S. holidays, So I rewrote the program to use a database for mulit-country use. Go check it out now.
Now I'll have to put my head in a Vice to stop the swelling after your kind words. Tks Pete. David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.