AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi Counting in a database table

Counting in a database table

Ein Thema von danten · begonnen am 30. Nov 2012 · letzter Beitrag vom 30. Nov 2012
 
danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#1

Counting in a database table

  Alt 30. Nov 2012, 09:59
Datenbank: Absolute Database • Version: 7.1 • Zugriff über: Absolute Database
Hello.
I need advice on how to count multiple entries in a database table from the third column to the last column in the whole table.
I need to count how many times the table number 1 and 10.
I use this code and it is not good:
Delphi-Quellcode:
procedure Tfrm_main._NE;
var
  i,y: integer;
begin
  Application.ProcessMessages;
with Table do
  begin
    DisableControls;
    y := 0;
    try
      First;
    while not EOF do
    begin
    for I := Table.FieldDefs.Count -1 downto 2 do
    begin
    if Pos('1', Table.FieldByName(Table.FieldDefs[i].Name).AsString) > 0 then
    begin
      y := y + 1;
      Label1.Caption := IntToStr(y) + ' x';
      Application.ProcessMessages;
    end;
    if Pos('10', Table.FieldByName(Table.FieldDefs[i].Name).AsString) > 0 then
    begin
      y := y + 1;
      Label2.Caption := IntToStr(y) + ' x';
      Application.ProcessMessages;
    end;
    end;
     Next;
     Application.ProcessMessages;
    end;
    finally
      EnableControls;
      Application.ProcessMessages;
    end;
  end;
The result is always the same!
Daniel
  Mit Zitat antworten Zitat
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz