Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Calc to determine if Date range contains a Saturda


This topic is 7163 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

This topic is 7163 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.