Home > Back-end >  The Delphi problem statement
The Delphi problem statement

Time:10-14

If (edt1. Text=' ') and (edt2. Text=' ') then
The begin
With qry1 do
The begin
The Close;
SQL. The Clear;
SQL. The Add (' select gs code, gs code2, gs. The name, the sum (sd) qty * s.i nv_qty_unary * (1)) XSSL, sum ((sd) amt + sd) tax) * s.i nv_qty_unary * (1)) xsje ');
SQL. The Add (' the from SDRPTS sd, subject s, gs, goods store st ');
SQL. The Add (' where sd. SND=st. gid ');
SQL. The Add (' and sd. Gdgid=gs. Gid ');
And sd. CLS in SQL. The Add (' (' retail ', 'retail' back) ');
SQL. The Add (' and sd. CLS=s.s ubname ');
SQL. Add (' and sd. Fildate & gt;="' + FormatDateTime (' yyyy. Mm. Dd, dtp1. Date) + ' ' ' ');
SQL. Add (' and sd. Fildate & lt;="' + FormatDateTime (' yyyy. Mm. Dd, dtp2. Date) + ' ' ' ');
SQL. The Add (' group by gs code, gs code2, gs. The name ');
The open;
end;
End


Single from the SQL statements written in DELPHI can export data but no data, do not know where the problem is, please prawns help have a look at

CodePudding user response:

+ FormatDateTime (' yyyy. Mm. Dd, dtp1. Date) + "'");
SQL. Add (' and sd. Fildate & lt;="' + FormatDateTime (' yyyy. Mm. Dd, dtp2. Date) + ' ' ' ');
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- & gt;>
+ FormatDateTime (' - dd yyyy - mm, dtp1. Date) + "'");
SQL. Add (' and sd. Fildate & lt;="' + FormatDateTime (' - dd yyyy - mm, dtp2Date) + ' ' ' ');

CodePudding user response:

Would you stop SQL. The add so many times you
STR: first string;
STR='; ' Add your those words, written in a
The SQL again. The add (STR);

CodePudding user response:

Print statements in the program to test and see which if you have any questions

CodePudding user response:

reference
SQL. Can you don't add so many times you
STR: first string;
STR='; ' Add your those words, written in a
The SQL again. The add (STR);

I think LZ this ADD is very good, neither a string, more readable and well

CodePudding user response:

You the problem of space oh, each section of the SQL statement, try adding a space

CodePudding user response:

Quotes question
SQL. Add (' and sd. Fildate & gt;='+' "' + FormatDateTime (' yyyy. Mm. Dd, dtp1. Date) + ' ' ' ');
  • Related