Date field validation

There is an issue which has been puzzling me for a while now. I currently have a field (date/time field) with default of “”. When the form is created, this field is blank. User is supposed to select from the date picker the date value for this field. However this value cannot be backdated, ie

Field value CANNOT BE earlier than current date

Is there any way to configure the field validation such that any date which has been selected and which is already in the past cannot be used?

User will have to be prompted that “backdated” dates cannot be used. Alternatively, “past” dates should not be displayed in the date picker.

Can this be achieved? Alternatives are welcome!!

Subject: Date field validation

I use this to my code.

		If Cstr(Format(Datevalue(uidoc.FieldGetText( "SignoffDate")), "yyyy/mm/dd")) < Cstr(Format(Datevalue(uidoc.FieldGetText( "DateEnded")), "yyyy/mm/dd")) Then			

			Message = Message +  "- The field 'Sign off'  is being delivered in the past. Please check the date." + Chr(13)

			If FieldName = "" Then FieldName = "SignoffDate"				

		End If	

You need to change it.

Hope it helps you.

Regards

Nick

Subject: RE: Date field validation

Lotusscript is all greek to me. Is there a formula equivalent of the same script?

Subject: Date field validation

@If(DateFieldValue-@Today<0;@Failure(“Date cannot be in the past”);@Success)

Subject: RE: Date field validation

thanks Rene. it worked a charm!

Didn’t expect that I could just use arithmetic to derive a figure! Always thought I had to convert the value of the date field to "number " first.

You saved my bacon!

Subject: RE: Date field validation

This worked perfectly for myself as well. But curious to know how someone would handle a time that lapses over the midnight hour making the time the next day…

For instance start time is 01:00 and some one mistakenly chooses 23:00 for the end time. This validation would return true if not taken in effect the day lapse.

Any suggestions on how one would handle this using formulas?

JW