fmsavey Posted June 4, 2004 Posted June 4, 2004 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.
Jim McKee Posted June 4, 2004 Posted June 4, 2004 Works fine here as: Month (date + 1) <> Month (date)
fmsavey Posted June 4, 2004 Author Posted June 4, 2004 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.
-Queue- Posted June 4, 2004 Posted June 4, 2004 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."]
fmsavey Posted June 4, 2004 Author Posted June 4, 2004 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?
-Queue- Posted June 4, 2004 Posted June 4, 2004 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.
Newbies ak98 Posted June 5, 2004 Newbies Posted June 5, 2004 Indeed there is a bug in validating fileds which are marked as global.
fmsavey Posted June 7, 2004 Author Posted June 7, 2004 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.
Recommended Posts
This topic is 7543 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now