Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Editor

Status
Not open for further replies.

juergenkemeter

Programmer
Oct 6, 2004
27
NZ
Hello,
I have a List Control Field (ListCtrl) in my form, with several columns. Name: COL1, COL2, COL3.
Is it possible to address a certain Column in this ListControl in a SQL statement? I want to catch the SUM of a certain Column via SQL.

/jk
 
Hi,

Please post the simply table data and the result you would like to get.

Grofaty
 
Hi,
I already found a solution yesterday. I don't retrieve data over the ListControl, but with direct SQL over the table.
Thanks anyway for offering your help!

Here is the solution, just for fun...

SELECT DISTINCT
CASE WHEN (
Select X.REPOMEN_SUM - Y.REENTMEN_SUM
from
(Select RECHPFID, sum(REPOMEN) REPOMEN_SUM from HILFSSTO.REBEW group by RECHPFID) X,
(Select RECHPFID, sum(REPOMEN)REENTMEN_SUM from HILFSSTO.REBEW WHERE RECHPFID = [ChargenpflegeID] AND REENTNDAT is not NULL group by RECHPFID) Y
where X.RECHPFID = Y.RECHPFID
and X.RECHPFID = [ChargenpflegeID]
) <= 20.000
THEN 'Alert, Substance Quantity too low'
ELSE 'Substance Quantity OK'
END CASE
FROM HILFSSTO.REBEW


/jk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top