Re: Getting Distict Values
- From: "Tom Woods" <twoods@xxxxxxxxxxx>
- Date: Fri, 8 Feb 2008 08:46:47 -0600
I believe I'm using the correct select statement, but not getting the
results.
In the following code, I'm trying to get the unique AsOfDates from the file
PrepaymentSpeeds. However, I get all records given the following select
statement.
Can anyone see what I'm doing wrong?
ADODataSetPrepaymentSpeeds.Active := False;
ADODataSetPrepaymentSpeeds.CommandText := cmdText;
ADODataSetPrepaymentSpeeds.CommandText := 'SELECT DISTINCT AsOfDate FROM
PrepaymentSpeeds';
ADODataSetPrepaymentSpeeds.Active := True;
while not ADODataSetPrepaymentSpeeds.Eof do
begin
{This test should not happen since we only have two unique "AsOfDate"
values.}
Inc(iNbrOfItemsAdded);
if( iNbrOfItemsAdded > 10) then break;
cboxAsOfDate.Items.Add(FormatDateTime('mm/dd/yyyy hh:mm:ss',
ADODataSetPrepaymentSpeeds.FieldByName('AsOfDate').AsDateTime) )
end;
ADODataSetPrepaymentSpeeds.Active := False;
Thanks,
Tom
"Bill Todd [TeamB]" <no@xxxxxx> wrote in message
news:47abca9e$1@xxxxxxxxxxxxxxxxxxxxxxxxx
SELECT DISTINCT ...
--
Bill Todd (TeamB)
.
- References:
- Getting Distict Values
- From: Tom Woods
- Re: Getting Distict Values
- From: Bill Todd [TeamB]
- Getting Distict Values
- Prev by Date: Re: MS Access driver
- Next by Date: Re: Getting Distict Values
- Previous by thread: Re: Getting Distict Values
- Next by thread: Re: Getting Distict Values
- Index(es):