Date Calculation - InfoPath Dev
in

InfoPath Dev

Date Calculation

Last post 07-08-2006 08:15 AM by Whitley. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 07-06-2006 09:44 AM

    Date Calculation

    hi,

    May i know how to write the coding to calculate two differ date?
    Can anyone send the sample code/form to me.
    thanks.

  • 07-06-2006 11:03 AM In reply to

    Hello,

    Please read the links below
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1711
    http://enterprise-solutions.swits.net/infopath/adding-time-calculating-differences.htm

    I hope it will help you.
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 07-06-2006 11:09 PM In reply to

    hi,

    May i know whether can put vbscript and vb.net together into visual studio.net?
    because i have load the form into infopath form into visual studio.net already.
    thanks in advance.
  • 07-06-2006 11:25 PM In reply to

    Hello,

    No both of them cannot work together. You can have any onething working. You cannot have managed code and Script working together.
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 07-07-2006 01:51 AM In reply to

    hi,

    ok, but right now i am looking for some example code (vb.net) to calculate the date from user input.
    so hope someone kindly advise.
    thanks.
  • 07-07-2006 03:11 AM In reply to

    Hi,

    this is vb.net code,

    Dim date1 As Date
    Dim date2 As Date
    Dim date3 As Date
    Dim date4 As Date
    Dim date5 As Date
    Dim d As Date
    date1 = Convert.ToDateTime(thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text)
    date2 = Convert.ToDateTime(thisXDocument.DOM.selectSingleNode("/my:myFields/my:field2").text)
    date3 = CDate(date1)
    date4 = CDate(date2)
    Dim daysElapsed As Int32

    daysElapsed = DateDiff("d", date3, date4)
    thisXDocument.DOM.selectSingleNode("/my:myFields/my:field4").text = daysElapsed

    I hope this will help you,

    Thanks.
    K.Ramana Reddy / http://www.ggktech.com
    India.
  • 07-08-2006 08:15 AM In reply to

    hi,

    i have sucessfully to did it.
    thanks you very much.
    :)
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.