Topic: Could not convert variant of type (UnicodeString) into type (Double)
procedure Form3_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
if form3.edit6.text + sqlexecute('select sum(ifnull(process, 0) + ifnull(unprocess, 0)) from out where id_sub =' +inttostr(form3.combobox1.dbitemid)) > sqlexecute('select gram from sub where id ='+inttostr(form3.combobox1.dbitemid)) then showmessage ('Not Allowed');
if form3.edit6.text + sqlexecute('select sum(ifnull(process, 0) + ifnull(unprocess, 0)) from out where id_sub =' +inttostr(form3.combobox1.dbitemid)) <= sqlexecute('select gram from sub where id ='+inttostr(form3.combobox1.dbitemid)) then form3.button3.click;
// if I disable below it works fine or if i put this in different button click event than both code above and below works fine.
if form3.edit4.text + sqlexecute('select sum(ifnull(process, 0) + ifnull(unprocess, 0)) from out where id_sub =' +inttostr(form3.combobox1.dbitemid)) > sqlexecute('select gram from sub where id ='+inttostr(form3.combobox1.dbitemid)) then showmessage ('Not Allowed');
if form3.edit4.text + sqlexecute('select sum(ifnull(process, 0) + ifnull(unprocess, 0)) from out where id_sub =' +inttostr(form3.combobox1.dbitemid)) <= sqlexecute('select gram from sub where id ='+inttostr(form3.combobox1.dbitemid)) then form3.button3.click;
end;
what is wrong here??
Could not convert variant of type (UnicodeString) into type (Double)