the calculation for field y would be:
If(a ≥ b;x-1;x)
Okay. Part of this works. The part that you gave me works, but if a is not equal to or greater than b, then the resulting number in x is displayed as a question mark.
If a is not equal to or greater than b, then I need x to be the same as y.
x will be equal to y - unless a is equal to or greater than b...
Hope this clarifies.
The calculation works as stated in your first question. You changed information in your comment. Which is correct?
As in question
I have four fields : x,y,a,b
y is a calculation field and x,a,b are all number fields
x=y unless a is = or > than b then will be 1 less than x.
thats what the formal will do.
the if statement is for y and says if a >= b; x-1 else it is x.
you need to besure your calculation return number.
here is sample app that computes as stated in question.
Yours works exactly the way it is supposed to. I'm not sure why I can't get mine to work the same way. I see that it's really simple, but I'm missing something. Thank you for the time you put in to answering this and making the sample db. I really appreciate it! I'll keep looking at mine and comparing with yours until I get it right.
I would be sure that the y cacluation is set to return a number and that all your other fields are numbers.
...and that the field size on the layout is wide enough to display the answer. Otherwise you get '?'.
I checked to make sure the layout was wide enough and that's not the problem. I think it has something to do with the way the records are stored. Your fields don't say anything about being stored, or indexed. Mine say "Unstored" then the If statement.
I finally figured it out. Mine works now exactly the way it's supposed to.
And, for future generation sof Filemaker Developers, the trick was...?