June 4, 200421 yr I'm trying to validate a date entered into a date field is the last day of the month. In the validate by calculation box I typed: Month (Period Date A + 1) [not equal symbol] Month ( Period Date A) Period Date A is the field I am validating. Would'nt the above statement only be true for any date that is the last day of the month. Does anyone know why this is not working. I could not type the "not equal sysmbol" so I wrote it out above.
June 4, 200421 yr Author Thanks for responding. I am having no such luck with FMP7. I just tried this in FMP6 and it works fine. I neglected to tell you that the field I am validating has been set to global. I wonder if this has something to do with it.
June 4, 200421 yr Why exactly are you validating the global? Are users entering the date? If so, why not just Set Field [gdate, Date( Month(gdate) + 1; 0; Year(gdate) )]? This will set it with the last day of the month for whatever date they enter. I often use a global text field in these cases, so that a script doesn't error if they enter an invalid date. Then I test If [Length(gtext) and IsValid(GetAsDate(gtext))] continue, otherwise Show Message ["Please enter a valid date."]
June 4, 200421 yr Author I just discovered that the validation calculation works just fine when the global field box is not checked. As soon as you check it, it does not validate as expected. Can anyone confirm this. By the way, one is supposed to be able to validate by calculation a global field, right?
June 4, 200421 yr It appears to only validate after data has already been entered. When you attempt to modify it, then it warns you. I wonder if this was fixed in the update.
June 7, 200421 yr Author Users are filling in this date to run a report where the last day of the month only makes sense. Thank you for your suggestion. Instead of validating the field I will just set it to the last day of the month for the date entered.
Create an account or sign in to comment