| View previous topic :: View next topic |
| Author |
Message |
Craig Leidy Guest
|
Posted: Thu Sep 18, 2003 4:04 pm Post subject: SQL Count(*) |
|
|
I'm executing "Select Count(*) from Res"
If I use the Advantage Sql Tool I get 21.
How do I get this number into a variable
in my Delphi program?
Thanks, Craig.
|
|
| Back to top |
|
 |
Mel Weaver Guest
|
Posted: Thu Sep 18, 2003 4:10 pm Post subject: Re: SQL Count(*) |
|
|
N1 = integer;
Select Count(*) as n1 from Res;
"Craig Leidy" <surfsoft (AT) comcast (DOT) net> wrote
| Quote: | I'm executing "Select Count(*) from Res"
If I use the Advantage Sql Tool I get 21.
How do I get this number into a variable
in my Delphi program?
Thanks, Craig.
|
|
|
| Back to top |
|
 |
Ray Marron Guest
|
Posted: Thu Sep 18, 2003 4:11 pm Post subject: Re: SQL Count(*) |
|
|
Craig Leidy <surfsoft (AT) comcast (DOT) net> wrote
| Quote: | I'm executing "Select Count(*) from Res"
If I use the Advantage Sql Tool I get 21.
How do I get this number into a variable
in my Delphi program?
|
If you're using this SQL in some sort of dataset-descendant component, it
will be the value of the first and only field in the one-record dataset:
MyQuery.Fields[0].AsInteger
--
Ray Marron
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Thu Sep 18, 2003 4:27 pm Post subject: Re: SQL Count(*) |
|
|
Assuming you are using a TAdsQuery component in your Delphi Program:
var
Cnt: Integer;
begin
Cnt := Qry.Fields[0].AsInteger;
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
|