Page 1 of 1

Update with MyQuery

Posted: Wed 02 May 2007 18:26
by EdderU2RSE
I have this query to update the items quantity and $

UPDATE productos
SET
stock = :stock
total = costo_uno*stock
WHERE
codigo = :codigo

in my button:
MyTable1.Edit;
QueryUpdate.Close;
QueryUpdate.SQL.Clear;
QueryUpdate.SQL.Text:='UPDATE productos SET stock,total= '+QuotedStr(inttostr(strtoint(DBedit3.Text)+strtoint(txtagregar.Text)))+'*'+QuotedStr(currtostr(strtoint(DBedit3.Text)*strtocurr(DBcosto_uno.Text)))+' WHERE codigo='+txtcodigo2.Text;
showmessage(QueryUpdate.SQL.Text);
QueryUpdate.Execute;


I only need to refresh $ when I change the items quantity,
Sample:
1 car=$150

If I buy 2 cars then $=300
3 cars =$450

But I have a mistake

My problem was solved

Posted: Thu 03 May 2007 13:21
by EdderU2RSE
My problem was solved succesfully.

Thanks

My problem was solved

Posted: Thu 03 May 2007 13:24
by EdderU2RSE
My problem was solved succesfully.

Thanks

My problem was solved :P

Posted: Thu 03 May 2007 13:31
by EdderU2RSE
My problem was solved succesfully.

Thanks :D :D