Week counter - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Week counter

Last post 01-31-2012 12:31 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-31-2012 08:09 AM

    • BRaZiL
    • Not Ranked
    • Joined on 01-31-2012
    • Posts 2

    Week counter

    Hi guys and girls,

    I have been searching this forum for a couple of days already and i cant find a solution for my "simple" problem.I have a form where my employees have to enter a week number which should be calculated based on the current day.

    The company that i work for started counting weeks on Feb 28th 1982, therefore the week that we are currently on is the 1561.

    I created a formula on excel where it does the math and all i have to do is enter todays date and the week number is automatically calculate. The formula on excel is =ROUNDDOWN((G1-(DATE(1982,2,28)))/7,0) where G is the column where we enter the dates.

    I have been for days trying to make this work on infopath but im yet to get it done. Please any help is welcome.

    Thank you a lot,

    BR

     

    PS i forgot to name the fields on my infopath form where i enter the dates. Todays date should be entered in a field called Set Date and the field where i want the week to be shown is called Week Date.

  • 01-31-2012 08:36 AM In reply to

    Do you happen to be using InfoPath 2010 / SharePoint 2010? And have Excel services installed on your SharePoint server? If so, you can actually use your Excel sheet to return the data to your form via web services instead of needing to write code for this...

    Hilary Stoupa

  • 01-31-2012 10:53 AM In reply to

    • BRaZiL
    • Not Ranked
    • Joined on 01-31-2012
    • Posts 2

     Hi Hilary,

    Thanks for the quick reply, but no I dont have InfoPath 2010, I am using the 2007 (I dont know if it could do the same thing). If it is possible to do the same thing in the 2007, how could I do this?

     

    Thanks once again.

  • 01-31-2012 12:31 PM In reply to

    I wonder if you could try this method to get the number of days between the two dates. It seems that if you could get that, you'd be able to then divide by 7 and take the substring of everything before the "." to effectively round down.

    Otherwise, you'll need to write custom code, or you could try qRules - which has a date diff function for getting the number of days between two dates....

    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.