Here is my code: (note, the database connection is no problem, table KCZL is a table in the database with SQLCA3 open) please help me have a look at, starting from the SQL query the wrong there? Would be all right in front of the SELECT
String ls_ypbh
Int number
Int r
If dw_1. GetRow () & gt;=1 then
R=dw_1. GetRow ()
Sle_2. Text=string (dw_1. Object. The DATA [r, 3])
Sle_3. Text=string (dw_1. Object. The DATA [r, 5])
Ddlb_2. Text=string (dw_1. Object. The DATA [r, 4])
//sle_5. Text=string (dw_1. Object. The DATA [r, 8])
//sle_15. Text=string (dw_1. Object. The data [r, 9])
Ls_ypbh=string (string (dw_1. Object. The DATA [r, 1)))
SELECT SUM (" KCZL ". "kcsl_mz")
Into: number
FROM "KCZL
"GROUP BY "KCZL". "ypbh
"HAVING "KCZL". "ypbh"=: ls_ypbh
The ORDER BY "KCZL". "ypbh" using SQLCA3;
Sle_4. Text=string (number)
End the if
If keydown (keytab! Then
Tab_1. Tabpage_1. Sle_4. Setfocus ()
end if
CodePudding user response:
SELECT SUM (kcsl_mz)Into: number
The FROM KCZL
Where ypbh=: ls_ypbh
Using SQLCA3;
CodePudding user response:
1/f, the wrong answer, don't come outCodePudding user response:
SELECT SUM (" KCZL ". "kcsl_mz") into: numberFROM "KCZL
"WHERE "KCZL". "ypbh"=: ls_ypbh
GROUP BY "KCZL". "ypbh
"ORDER BY "KCZL". "ypbh" ASC using SQLCA3;
If not, then you have a breakpoint debugged, see ls_ypbh value didn't get to,
CodePudding user response:
I tested, ls_ypbh value no problemCodePudding user response:
I thought for a moment, is not to add a loop statement? If and how to judge whether or not to the end of the table?CodePudding user response:
KCZL there? Assess the
Select count (*) into: (I) the from KCZL
Where ypbh=: ls_ypbh using sqlca3;
Look at how much I was! 0 is not number
Grouping sum? Your group is ls_ypbh, it group, what's the use of the sorting!
If i> 0 then
The select sun (kcsl_mz) into: number
The from KCZL
Where the using sqlca3;
The else
Return
End the if
It's ok
CodePudding user response:
The grammar of the 1/f, no problem, the estimate is the issue of data.