Access Table calculated Field error: The expression couldn't be saved because its result type Binary or Null

896 Views Asked by At

I have TotalMarks field as ShortText because it could be a number or N/A. If [Math] value is N/A then TotalMarks is N/A otherwise sum of [Math]+[Physics]

IIf([Math]="N/A","N/A",CDbl([Math])+CDbl([Physics]))

[Math] and[Physics] are short text fields.

1

There are 1 best solutions below

0
Gustav On

Always store numbers as number. Thus:

  • Change the data type of the fields to, say, Double
  • Set Default Value for both fields to nothing (clear the property)
  • Use Null for N/A
  • Use this expression for TotalMarks: =[Math]+[Physics]
  • Apply this Format to all three fields: 0.0000,,,"N/A". (Adjust count of decimals as needed)

(If outside the US, use this Format: 0,0000;;;"N/A")