Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mo 26.05.03 17:21 
Hi,

wenn ich mit dem SQL Befehl SUM() mir die Summe aller Werte in einer Spalte ausrechnen lasse, wie kann ich'n dann mit einem TQuery (bzw TAdsQuery) auf den errechneten Wert zugreifen???

ausblenden Delphi-Quelltext
1:
Query.SQL.Text:='SELECT SUM(xxx) FROM yyy WHERE ID=1';					


Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mo 26.05.03 17:59 
Hab es hinbekommen :)

_________________
Aya
I aim for my endless dreams and I know they will come true!
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Mo 26.05.03 22:00 
du kannst das ganze auch mit einem as befehl vereinfachen

du schreibst

ausblenden Delphi-Quelltext
1:
Query.SQL.Text:='SELECT SUM(xxx) AS summe FROM yyy WHERE ID=1';					


dann aknnst du ancher so auf das ergebnis zugreifen

ausblenden Delphi-Quelltext
1:
query1.fieldvalues['summe'];					


das summe zählt dann quasi wie ein feld aus der db

gr€€tz