How does I count workdays between two dates by managed code? - InfoPath Dev
in

InfoPath Dev

How does I count workdays between two dates by managed code?

Last post 11-09-2007 10:07 AM by jatuphum. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-07-2007 02:24 AM

    How does I count workdays between two dates by managed code?

    Hi all,

    I want to count workdays between two dates, such as 12 Dec 2007 to 11 Jan 2008.

    I want to use by managed code.

    Cheers.

    インフォパス ● デべロッパー
  • 11-07-2007 05:34 AM In reply to

    Re: How does I count workdays between two dates by managed code?

    The common way is to use the Datediff function and VBscript. Many examples here but here is onewith code.

    http://www.infopathdev.com/forums/p/5646/21172.aspx#21172

  • 11-08-2007 11:17 PM In reply to

    Re: How does I count workdays between two dates by managed code?

    Hi Clay,

    Thank you for your reply. But I explain to you about my problem.

    I don't want include of 'Saturday' and 'Sunday' of week.

    May be I use loop for solve this problem?

    Cheers.

    インフォパス ● デべロッパー
  • 11-09-2007 07:30 AM In reply to

    Re: How does I count workdays between two dates by managed code?

    You would have to use more complex logic and calculate the number of Saturdays and Sundays between your two dates and then subtract that from your total.  I believe with DateDiff there is a way to get day of week so you could use this to filter the results which would be counted and step through (while loop) each following date and if it was not a weekend add to your sum value.

  • 11-09-2007 10:07 AM In reply to

    Re: How does I count workdays between two dates by managed code?

    Hi Clay,

    Thank you again. Because while loop from your Idea so now I can solve my problem.

    Cheers.

    インフォパス ● デべロッパー
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.