Date Picker Data Validation

L

LyLy

Hello,

I am trying to add validation to a Date Picker field which would not allow
the end user to enter a date greater than 5 weeks in the past. Can this be
done in the Validation selection and if so, how? Your help is greatly
appreciated.

LyLy
 
H

Hilary Stoupa

Hello:

Are you using InfoPath 2007? If so, there is the addDays() function
available to you. To use this in data validation, right click on the field
you wish to validate, select Data Validation and select Add to open a new
condition. Leave the first box set to your field, set the second box to is
less than or equal to, and in the third box, select Use a formula. In the
formula editor, insert the function addDays. The first argument should be
your date field and the second should be -35 (to subtract 5 weeks):

addDays(today(), -35)

Add your screen tip as appropriate. If you want your date between a range,
you can add a second condition.
 
L

LyLy

Hi Hilary,

Thank you. Unfortunately I am using InfoPath 2003. Does that mean this
doesn't apply? Is there another way to do it in 2003?

Thank you so much
LyLy
 
M

mjahani

Hi,

I tried to start a new question but the system didn't let me do it. Anyway,
my problem is:
I have a form using database and I need to compare a submission date from
database called (DATE_SUBMITTED) with today's date minus 21 days. The idea is
to show the record if the DATE_SUBMITTED is less than Today'date minus 21. I
tried several ways, didn't work. Can you please help me with this? Thanks
 
H

Hilary Stoupa

Hi -- you don't say if you are using IP2007 or IP2003. With 2003, there is no
AddDays() function, so I'm afraid you'll need code. If you are using 2007,
you can use addDays(today(), -21) to get today less 21 days.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top