标签:start 效果 htm 图片 path containe led main figure
找了几天,终于找到一个简单一点的办法,虽然公式有点复杂,让人看不懂,但是效果很好,月份不一样也可以。
I was able to find a product that I used to resolve the "delta" = the difference between dates.
The link is listed: http://www.bizsupportonline.net/infopath2007/calculate-date-difference-infopath-rules-formulas.htm
Calculate the difference between two date picker controls in InfoPath using rules and formulas - no code!
Use rules, conditions, and the number(), floor(), and substring() functions in formulas to calculate the difference between two date picker controls in InfoPath.
Use rules, conditions, and the number(), floor(), and substring() functions in formulas to calculate the difference between two date picker controls in InfoPath.
You have a form template with two InfoPath date picker controls and you would like to calculate the difference between the two date picker controls without writing code.
Use rules, conditions, and the number(), floor(), and substring() functions in formulas to calculate the difference between two date picker controls in InfoPath.
You can accomplish this functionality as follows:
(number(substring(../my:endDate, 9, 2))
+ floor((153 * (number(substring(../my:endDate, 6, 2)) + 12 *
(floor((14 - number(substring(../my:endDate, 6, 2))) div 12)) - 3) + 2)
div 5) + (number(substring(../my:endDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:endDate, 6, 2))) div 12))) * 365 +
floor((number(substring(../my:endDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:endDate, 6, 2))) div 12))) div 4) -
floor((number(substring(../my:endDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:endDate, 6, 2))) div 12))) div 100) +
floor((number(substring(../my:endDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:endDate, 6, 2))) div 12))) div 400) - 32045) -
(number(substring(., 9, 2)) + floor((153 * (number(substring(., 6, 2)) +
12 * (floor((14 - number(substring(., 6, 2))) div 12)) - 3) + 2) div 5)
+ (number(substring(., 1, 4)) + 4800 - (floor((14 - number(substring(.,
6, 2))) div 12))) * 365 + floor((number(substring(., 1, 4)) + 4800 -
(floor((14 - number(substring(., 6, 2))) div 12))) div 4) -
floor((number(substring(., 1, 4)) + 4800 - (floor((14 -
number(substring(., 6, 2))) div 12))) div 100) +
floor((number(substring(., 1, 4)) + 4800 - (floor((14 -
number(substring(., 6, 2))) div 12))) div 400) - 32045)
(number(substring(., 9, 2)) +
floor((153 * (number(substring(., 6, 2)) + 12 * (floor((14 -
number(substring(., 6, 2))) div 12)) - 3) + 2) div 5) +
(number(substring(., 1, 4)) + 4800 - (floor((14 - number(substring(., 6,
2))) div 12))) * 365 + floor((number(substring(., 1, 4)) + 4800 -
(floor((14 - number(substring(., 6, 2))) div 12))) div 4) -
floor((number(substring(., 1, 4)) + 4800 - (floor((14 -
number(substring(., 6, 2))) div 12))) div 100) +
floor((number(substring(., 1, 4)) + 4800 - (floor((14 -
number(substring(., 6, 2))) div 12))) div 400) - 32045) -
(number(substring(../my:startDate, 9, 2)) + floor((153 *
(number(substring(../my:startDate, 6, 2)) + 12 * (floor((14 -
number(substring(../my:startDate, 6, 2))) div 12)) - 3) + 2) div 5) +
(number(substring(../my:startDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:startDate, 6, 2))) div 12))) * 365 +
floor((number(substring(../my:startDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:startDate, 6, 2))) div 12))) div 4) -
floor((number(substring(../my:startDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:startDate, 6, 2))) div 12))) div 100) +
floor((number(substring(../my:startDate, 1, 4)) + 4800 - (floor((14 -
number(substring(../my:startDate, 6, 2))) div 12))) div 400) - 32045)
You should now have a fully functional InfoPath form that will calculate the difference between the dates soon after you have entered valid dates. This solution also works for InfoPath 2003 form templates and InfoPath 2007 browser-enabled form templates.
标签:start 效果 htm 图片 path containe led main figure
原文地址:https://www.cnblogs.com/jpinsz/p/12455011.html