Date Difference Calc - Holiday Request Form - InfoPath Dev
in

InfoPath Dev

Date Difference Calc - Holiday Request Form

Last post 09-18-2009 09:47 AM by Alec Pojidaev. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-06-2008 06:14 AM

    Date Difference Calc - Holiday Request Form

    Hi there, ive searched the forums but cannot find a solution to the exact problem I have so im posting it here :)

     
    Ive made and published a browser compatible InfoPath 2007 holiday request form onto a SharePoint Server 2003 site, ive got all the basics working but now I need to display on the form the number of days the holiday request is for.

     

    So what I need to calculate is the difference between the 2 date pickers I have on the form (startdate & enddate), less weekends and public holidays.

     

    I have found some solutions to the same question but all that I have found have been in VBScript, but im led to believe that using VBScript will mean my forms will no longer be browser compatible, so this is not an option :(

     

    Does anyone have a solution to this in Visual Basic or C#?

     

    Thanks
     

  • 02-06-2008 08:15 AM In reply to

    Re: Date Difference Calc - Holiday Request Form

    Welcome to the forum.

    If you have SharePoint 2003 then why are you concerned about browser compatibility?  You need SharePoint 2007 to render a form in a browser anyway. Are you planning on an upgrade in the near future?

    I have used the datediff() many times but I am sure there are similar functions in managed code.

    Another method is to cretate a list of dates and values and use that to make your calculation.

    Date     Value 

    01/01     1

    01/02     1

    01/03     1

    Then you could use the sum function where startdate was less then enddate in list and enddate was greater than startdate in list.

    Another option since typiclaly holiday is not going to be for large date ranges is to break up the dates extract the days and then do a math calculation. Obviously you would have to take into account holidays which were over a month change.

     Hope that helps.

  • 02-06-2008 08:43 AM In reply to

    Re: Date Difference Calc - Holiday Request Form

    Sorry my bad, I meant to say we have both IP 2007 and SPS2007.

    I will have a look into those suggestions and see where I get, im quite new using IP & SPS so its going to be a big learning curve!

    Thanks
     

  • 09-18-2009 09:47 AM In reply to

    Re: Date Difference Calc - Holiday Request Form

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