I have two date fields with time. Start Date and End Date. I always want the End Date to be after the Start Date.
I can’t use Field Validation against a different Field value.
So I thought - I’ll calculate the duration, then condition on a negative value. I can’t put a conditional on a calculated field. I also can’t put any rules on the form.
Ideas on how a negative duration can be prohibited?
Here is a way that works, not perfect but it might get you by.
Set a conditional rule to set the End date to a text field value (doesn’t matter which one). If the end date is less that the start date, it just puts a blank value in the field.
So that works in the backend but not on a form. Knack doesn’t allow you to add the End field because of the conditional.
I’m trying to “hard code” the date to Jan 1, 1900 (beginning of the HYF dates) and then I’m conditioning the field on that date… Going to see how that works.
Add a second End input field. I call mine End Input for illustration purposes. Use the following Conditional rules. The End Input appears on your Add & Edit forms. The actual “End” field appears on the grid.
This is even better:
And it helps if you add this rule to your edit form:
Note: Knack puts the 12:00AM in there, but no harm
Thank you. It still seems like I’m going down a GIGO (garbage in, garbage out) road… This doesn’t stop the entry of invalid data, but constrains what that invalid data is. If they don’t enter an end date/time after the start, they could have
It’s odd that you can’t do field level comparisons.
We can only hope that with all the changes Knack is making, they will catch up. Hopefully sooner rather than later.
So I was playing around… I have a calculated duration field. I created a number field, set by a conditional rule… then set a validation rule… The field values show a negative value in the field… But the Validation never fires… I’m assuming that the conditional rule only fires after he validation has completed. Therefore it’s never triggered…
I really thought I was onto something… Dang…