filemaker

Why is this Calculation not giving me a result


I created an ExecuteSQL Calculation:

ExecuteSQL ( "SELECT BaseRent FROM obj_Unit_CurrentRenter_RentAmount WHERE RenterUnitID = ? AND CurRent  = 1" ; "," ; ""; RenterUnitID)

I've verified that is works when I take out the AND CurRent = 1 clause. However, with that part in it, the calculation returns a ?.

CurRent is a Number field.


Solution

  • The problem is that your field name CurRent collides with the reserved word CURRENT.

    Change your formula to:

    ExecuteSQL ( "SELECT BaseRent FROM obj_Unit_CurrentRenter_RentAmount WHERE RenterUnitID = ? AND \"CurRent\"  = 1" ; "," ; ""; RenterUnitID)