Re: query unique count for field
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Thu, 19 Jan 2006 08:12:55 -0500
Unless you have some other field to determine the ranking order of your same
values, I know of no way to display the results you want using SQL. You
could probably write a VBA function to do this or if your order was static
you could write some VBA to step through the recordset and assign the value
to a (new) field in your table.
"Lancslad" <Lancslad@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3A9F9C54-808C-4F38-889E-72043EDFA6D9@xxxxxxxxxxxxxxxx
> I'm not sure this does what is required here. The SQL will group and count
> each record, but I understand that a sequential running sum is required
> for
> each record within a group. This should be fairly simple, but I've been
> puzzling over it for weeks. Anyone able to help?
>
> "KARL DEWEY" wrote:
>
>> Create a TOTALS query. Edit the SQL below with your table and field
>> names.
>>
>> SELECT YourTable.YourNumberField, Count(YourTable.YourNumberField) AS
>> CountOfNumber
>> FROM [YourTable]
>> GROUP BY YourTable.YourNumberField;
>>
>>
>> "flc123" wrote:
>>
>> > I am trying to count a sorted number field in a query. For each
>> > identical
>> > number I want the count to increment by one.
>> > For example
>> >
>> > Number Count
>> > 183 1
>> >
>> > 222 1
>> > 222 2
>> > 222 3
>> >
>> > 343 1
>> >
>> >
>> > thanks
>> >
.
- Prev by Date: Re: Altering fields in a query
- Next by Date: Re: Use crosstab column heading in a calculation
- Previous by thread: Help with time difference query
- Next by thread: Re: query unique count for field
- Index(es):
Relevant Pages
|
Loading