Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Business Day formula 1

Status
Not open for further replies.

kimchavis

Technical User
Jan 7, 2004
66
US
I need help with a Business Day formula. I am trying to figure out how to write a formula that would tell me when a due date would be in which the due date would only fall between a Monday and a Friday. I have a formula that calculates the days old based on Business Days old:

Local DateTimeVar d1 := {LOAN.DISBURSAL_DATE};
Local DateTimeVar d2 :={LOAN_USER.CLOSING_PACKAGE} ;
DateDiff ("d", d1, d2) - DateDiff ("ww", d1, d2, crSaturday) - DateDiff ("ww", d1, d2, crSunday)-2 -{@total}

This formula tells me how many business days it is from the due date. I want to have a formula that tells me what the due date is. This formula produces a number. If this number were 2 and I wasnt worried about business days i could do currentdate - {@networkdaysold} (formula above) but if this result were to fall on a Saturday or Sunday it would be wrong. How do I combat this?

Thanks.
 
If DayOfWeek({@DueDateCalc}) in [1,7] then "Weekend"

Is this what you are looking for?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
That helped me to get the formula I was looking for THANKS!!!!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top