I have two fields Field1 and Field2 in my table. I want to update Field1 using Field2 using the following code:
Query1.SQL.Add('Update debts Set Field1=:PPercentAZM * Field2 Where (Currency="$")and(Calcul=True)');
Query1.ParamByName('PPercentAZM').AsFloat := Table1.FieldByName('FieldName').AsFloat;
It gives me an error with message "Error creating cursor handle". I tried to do something via SQL Explorer using the following code:
Update debts Set Field1=Field2 * 4924 Where (Currency="$")and(Calcul=True)
It's not giving error, but doesn't calculate anything.
What i should do in order to change values of all fields in dataset using values of other fields? (Certainly with SQL)