April 12, 200520 yr This is a true left brain problem that I don't have the capacity to sort out. Here is the right brain description. Our public access television center signs out equipment to members for several days at a time. Members get contracts that allow them to use equipment for up to so many full 24 hour days, we do not track by the hour. So if a member takes a camera from Tuesday to Thursday, then his contract is marked up with 2 camera uses. But since we are closed on Fridays, the members get a free day, so Friday to Sunday is counted as one day. So that is my problem. I need a calculation that will give me the number of days between Date Out to Date In -but- subtract one day if that range contains a Saturday. I tried lots of methods and I can't figure it out! I think I just don't have the experience to work it through, my skills are pretty basic in the scripting area. The variables I have are CheckinDate, CheckoutDate, and the end result is a number CheckoutDays. I'm too embarassed to post any of the work I have done, but maybe someone out there with a lot of experience would be willing to show me the right method! Thanks so much, Sean http://www.cctvcambridge.org
April 12, 200520 yr I think I would understand this better if you'd have said "We are closed on Saturdays". Anyway, I believe (didn't test it too thoroughly) this calc will return the number of days between start and end, excluding any Saturdays in-between: end - start - ( ( end - DayOfWeek (end) ) - ( start - DayOfWeek (start) ) ) / 7
April 13, 200520 yr Author This is great! And it seems to be good for any date range, even beyond one week, as best as I can figure. Thanks for your time!
Create an account or sign in to comment