Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
NSC | Saved Search Formula > Number of Weekdays between Two Dates
Scenario
User want to add a Formula field to a Saved Search that would show the difference between two date fields, but only display business days and not include weekends.
Solution
In a Formula (Numeric) field, add this formula:
- ROUND(((TO_CHAR({enddate}, 'J') - TO_CHAR({startdate}, 'J'))) - ((((TRUNC({enddate}, 'D')) - (TRUNC({startdate}, 'D')))/7)*2)-(CASE WHEN TO_CHAR({startdate}, 'DY') = 'SUN' THEN 1 ELSE 0 END) - (CASE WHEN TO_CHAR({enddate}, 'DY') = 'SAT' THEN 1 ELSE 0 END), 0)
Note that the formula above assumes that the {enddate} is the same, or after the {startdate}.
If you have some cases where the {enddate} is before the {startdate}, then the formula might give inaccurate results. If you want to show the
Learn how to Refer A Member | Earn the Answer Accepter Badge | Be the Content Creator of the Quarter | Vote for the content you want to see!