I want to change the text of label1 by multiplying query field with value of spinBox1. But it doesn't work. ** Fields[3] saved as Integer in my table **
label1.Text := MSQuery1.Fields[3].AsInteger * spinBox1.Value;
or
label1.Text := MSQuery1.Fields[3].AsInteger * spinBox1.Text.ToInteger;
MSQuery1.Fields[3].AsInteger * spinBox1.Text.ToInteger
is an integer, butLabel1.Text
is a string. You thus need to make a string from the RHS integer:label1.Text := IntToStr(MSQuery1.Fields[3].AsInteger * spinBox1.Text.ToInteger);
. Actually, a bit of experimentation would have made you realise that this has nothing to do with SQL at all: If you had replaced your line withlabel1.Text := 5 * 20
, you would have received the same error but with fewer confounders.