'select sum(fieldname) as abc from table where number='''(edit1.text)+''''
showmessage(query.fieldByName('abc').AsString)