Date() plus 3 days - InfoPath Dev
in

InfoPath Dev

Date() plus 3 days

Last post 08-23-2005 11:22 PM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 08-17-2005 12:56 PM

    Date() plus 3 days

    Hey all,

    I'm trying a condition and don't think it's working right. What I'm looking for is: "If [start date] is less than 3 days from today, display "72 hours" in a message box. The condition that I have tried is: [start date] is less than --->"today()+3" <---this a formula, which hasn't worked so far. If I take the "+3" off then the formula works great but I need to be able to check for a three day range. Any ideas?

    Thanks!
  • 08-17-2005 04:59 PM In reply to

    Hi WCO!
    Dates are different data types than whole numbers. You will need to add some code (OnAfterChange event handler function) to take apart the Date object and subtract 3 days from it and check it against Today. If it's true you can display a message box from code, or set some field that controls the message box. Dealing with dates is a frequent request. Check out the following MS blog on them:http://blogs.msdn.com/infopath/archive/2005/01/25/360318.aspx
    Good luck

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-17-2005 05:02 PM In reply to

    Here's another link on how to do this in JScript:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvid/html/msdn_vidateadd.asp

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 08-23-2005 11:48 AM In reply to

    Hey Patrick,

    Sine code and I don't work well together most of the time, I found another figuratively simple way to acheive my request. In my Access Project, I created a query that uses the formula "DATEADD(D,3,GETDATE())". I then created a secondary data connection to this field and now use it to compare to the start date. Works great, less filling!!!

    Thanks Patrick!
  • 08-23-2005 11:22 PM In reply to

    Ooh, very cool solution! Nice work WCO!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.