Field Validation using dates

A

Art

I think I know the answer but want to ask anyay :)

Using Infopath 2003.

I have a field that I want to be required is a 'Needed by Date" is less than
10 days from today.

Is there a way to compare today and the Date needed by to get the 10 day
window without writing script?
 
S

S.Y.M. Wong-A-Ton

Not sure whether you want to add or subtract 10 days, but assuming you want
to add 10 days, you might be able to add 10 days to today using the
substring() function to extract the day and add 10 days to the day, and then
use conditions to check whether the calculated date falls in the following
month or not. But the logic would soon become too complex and things like
testing for a leap year using rules and conditions when your date falls in
February would be a nightmare.

Solution: Use code for date calculations like this one.
 
A

Art

I think it will be easier to get my network guys to upgrade to IP 2007 than
to teach me code :)
 
S

S.Y.M. Wong-A-Ton

You might not entirely escape coding! While InfoPath 2007 has date functions
to add days and seconds, it does not (yet) have date functions to calculate
the difference between dates, so for the latter you will have to resort to
code. I've put in a request for the latter, but perhaps if more people voted
for a date difference function to be added to InfoPath, my request would have
more weight...
 
Top