1 2 3 4 5 6 7 8 9 10 11 12 13 14
| Query1.Close;
Query1.sql.clear;
Query1.sql.Add('SELECT CCode,CTitle,CSurname,CName,CStatus,CAdress1,CAdress2,CAdress3,CPostCode,CCity,CCountry,CEMAIL,CInterest,CLContact,CTotMoney,CWeb,CPhone1,CFax,CMobile');
Query1.SQL.Add('From Clients');
Query1.Open;
Query2.Close;
Query2.sql.clear;
Query2.sql.Add('SELECT S.SCode');
Query2.SQL.Add('FROM Sales S');
Query2.SQL.Add('JOIN Clients C ON (C.CCode=S.SCCode)');
Query2.SQL.Add('WHERE C.CCode=:x');
Query2.Params[0].AsString:=Query1.Fields[0].AsString;;
Query2.Open; |
Partager