Add working days to datepicker field in infopath 2010

Hello experts,

How can I add working days in a given datepicker field in infopath 2010 and the result will be calculated in a second datepicker field as a calendar day, including weekends, without writing code?

Thanks
GeorgegianAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
WHat do you mean without writing code?

Even adding 1 working day is difficult since if the next day is non-working you have to add 2 days then check again.

Do you need to worry about holidays?

mlmcc
0
GeorgegianAuthor Commented:
Hi mlmcc,

I mean that, is there a custom function that calculates the calendar day by adding working days is a given date? Custom function that uses Infopath object and functions and not code written in any other language like VB or C etc.
0
GeorgegianAuthor Commented:
Hi mlmcc

Regarding holidays, this custom function calculates only working days and ignores holidays.



Georgegian
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mlmccCommented:
I know of some in VB.  I am not an InfoPath programmer so have no knowledge there.

Is this at all useful?
It is code but not in a language I recognize.

http://www.infopathdev.com/forums/t/7156.aspx

Basic algorithm it uses is to calculate the number of weeks (5 days in a business week) and the number of days remaining.  it then adds the days one at atime ensuring the day added is a business day

mlmcc
0
klafkasCommented:
The infopath form contains 3 basic fields, absence_days (integer), start _date (date picker) and   end_date (date picker).
There are also 3 additional hidden fields (all integer type) called f1 ,  f2 and f3.
The F1 field stores the number of the day of the week.
The F2 field stores the remain days of the week
The F3 field stores the total of the absence days including weekends if exists.
Several action rules are applied when the field star_date changed.
1.      Set value to F1 field  XPath mode
(number(substring(., 9, 2)) + floor(((153 * (number(substring(., 6, 2)) + (12 * floor((14 - number(substring(., 6, 2))) div 12)) - 3)) + 2) div 5) + (365 * (number(substring(., 1, 4)) + 4800 - floor((14 - number(substring(., 6, 2))) div 12))) + floor((number(substring(., 1, 4)) + 4800 - floor((14 - number(substring(., 6, 2))) div 12)) div 4) - 32039) mod 7

2.      Set value to F2 field  XPath mode
7 - ../my:F1
3.      Set value to F3 field XPath mode
../my:AbsenceDays - 1 + floor((../my:AbsenceDays + 5 - ../my:F2) div 5) * 2
4.      Set Value to End_Date field
xdDate:AddDays(., ../my:F3)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GeorgegianAuthor Commented:
Thanks klafkas,

i test your solution and it works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
InfoPath

From novice to tech pro — start learning today.