Update with MyQuery

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
EdderU2RSE
Posts: 10
Joined: Tue 17 Apr 2007 19:47

Update with MyQuery

Post by EdderU2RSE » Wed 02 May 2007 18:26

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

EdderU2RSE
Posts: 10
Joined: Tue 17 Apr 2007 19:47

My problem was solved

Post by EdderU2RSE » Thu 03 May 2007 13:21

My problem was solved succesfully.

Thanks

EdderU2RSE
Posts: 10
Joined: Tue 17 Apr 2007 19:47

My problem was solved

Post by EdderU2RSE » Thu 03 May 2007 13:24

My problem was solved succesfully.

Thanks

EdderU2RSE
Posts: 10
Joined: Tue 17 Apr 2007 19:47

My problem was solved :P

Post by EdderU2RSE » Thu 03 May 2007 13:31

My problem was solved succesfully.

Thanks :D :D

Post Reply