There is a query Goodsmovement with the column [Type of change]. For a row with 1,putaway should be used.
Type of change: If(Goodsmovement.[Type of change]=1,Putaway,Pickup).
I get an error that says the expression you entered contains an invalid number. How to fix this?
I did this Type of change: If(Goods movement.[Type of change]=1, "Putaway", "Pickup"). Then I get the error the expression you entered is syntactically incorrect
I did this Type of change: If(Goods movement.[Type of change]=1, "Putaway", "Pickup"). Then I get the error the expression you entered is syntactically incorrect
I doubt that is a properly translated error message, so my first guess is that Type Of Change is a text field and not a numeric field. So maybe
iif(Goodsmovement.[Type of change]="1","Putaway","Pickup").
I doubt that is a properly translated error message, so my first guess is that Type Of Change is a text field and not a numeric field. So maybe
iif(Goodsmovement.[Type of change]="1","Putaway","Pickup").
OK, let's apply a little logic to the original question.
Code:
If(Goodsmovement.[Type of change]=1,Putaway,Pickup).
You said this was in a query context. Your original error says "invalid number." Goodsmovement.[Type of change] is not in the context of a number and would not be presumed to be a literal number. The digit 1 is a valid number so that isn't it. There remain three possible things that could lead to the error.
Putaway and Pickup, appearing without quotes in SQL context would be taken as field names which would have to exist in the named record. But I would anticipate a different message in that case. The other possibility is that whatever is in the record in field [Type of change] might ALSO not be a valid number, which would stop before it got a chance to complain about the meaning of Putaway or Pickup.
When someone expressed the need for quotes, you replied:
I did this Type of change: If(Goods movement.[Type of change]=1, "Putaway", "Pickup"). Then I get the error the expression you entered is syntactically incorrect
If that is a mis-type, your error is the space in (Goods movement.[Type of change] but you suggested a mistranslation. So was the mistranslation to turn that into two words or is the error something else?
You need to give us a bit more to work with. June7 was quite correct to ask to see the SQL statement. This is like swinging at a pinata while blindfolded. Please when you ask a question, explain at least a BIT more. We are at 17 posts and still grasping at straws because some aspect of this problem is not clear yet.
The displayed values belong in a lookup table against a numeric key. Join the table to the data so the displayed value is directly available from the table.