Quantcast
Channel: SharePoint Legacy Versions - Using SharePoint Designer, InfoPath and Other Customizations Forum
Viewing all articles
Browse latest Browse all 2319

How to calculate business days excluding saturdays and sundays given between two dates in Infopath (My Form is SharePoint List Form)

$
0
0

I am trying to get the business days excluding the weekends in between given dates. I found XPath formula over net to find the difference between two dates

number(substring(EndDate, 9, 2)) + floor((153 * (number(substring(EndDate, 6, 2)) + 12 * floor((14 - number(substring(EndDate, 6, 2))) div 12) - 3) + 2) div 5) + (number(substring(EndDate, 1, 4)) + 4800 - floor((14 - number(substring(EndDate, 6, 2))) div 12)) * 365 + floor((number(substring(EndDate, 1, 4)) + 4800 - floor((14 - number(substring(EndDate, 6, 2))) div 12)) div 4) - floor((number(substring(EndDate, 1, 4)) + 4800 - floor((14 - number(substring(EndDate, 6, 2))) div 12)) div 100) + floor((number(substring(EndDate, 1, 4)) + 4800 - floor((14 - number(substring(EndDate, 6, 2))) div 12)) div 400) - 32045 - (number(substring(StartDate, 9, 2)) + floor((153 * (number(substring(StartDate, 6, 2)) + 12 * floor((14 - number(substring(StartDate, 6, 2))) div 12) - 3) + 2) div 5)+ (number(substring(StartDate, 1, 4)) + 4800 - floor((14 - number(substring(StartDate, 6, 2))) div 12)) * 365 + floor((number(substring(StartDate, 1, 4)) + 4800 - floor((14 - number(substring(StartDate, 6, 2))) div 12)) div 4) - floor((number(substring(STartDate, 1, 4)) + 4800 - floor((14 - number(substring(StartDAte, 6, 2))) div 12)) div 100) + floor((number(substring(StartDate, 1, 4)) + 4800 - floor((14 - number(substring(StartDAte, 6, 2))) div 12)) div 400) - 32045) + 1

What i need to do exclude weekends in the above formula?

Thanks for your help!


Viewing all articles
Browse latest Browse all 2319

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>