Greetings Techyv. Hope all is well. I would like to know how to create day of week in Infopath form function effectively. I'm looking for a detailed guide regarding this. Please include an overview and key features of this kind of form. Be specific and guide me through a step by step process. Thank you.
How to create day of week in Infopath form function.
Hello Robert,
You may try the following steps:
1. Create a Date Picker control, which, in this instance, I’ll name “Date”; then create a Text Box control, which we can name, “Days”;
2. Type the following rule to your “Date” box:
(number(substring(., 9, 2)) + number(number(substring(., 1, 4)) – (floor((14 – number(substring(., 6, 2))) / 12))) + floor(number(number(substring(., 1, 4)) – (floor((14 – number(substring(., 6, 2))) / 12))) / 4) – floor(number(number(substring(., 1, 4)) – (floor((14 – number(substring(., 6, 2))) / 12))) / 100) + floor(number(number(substring(., 1, 4)) – (floor((14 – number(substring(., 6, 2))) / 12))) / 400) + floor((31 * number(number(substring(., 6, 2)) + 12 * (floor((14 – number(substring(., 6, 2))) / 12)) – 2)) / 12)) mod 7
3. Then right click your “Days” box and paste the code:
4. Assign the following rule:
if Days == 0 then set "Sunday" Days
if Days== 1 then set "Monday" to Days…and so on until you reach “7” for “Saturday”
5. Now you’re all good to go. If you select a particular date in Date Picker control, it will show the days of the week.
Hope this helps your concern.