Re: query unique count for field



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
>> >


.



Relevant Pages

  • Re: query unique count for field
    ... FROM q1 INNER JOIN iotas ... >> Unless you have some other field to determine the ranking order of your ... I know of no way to display the results you want using SQL. ... >> could probably write a VBA function to do this or if your order was ...
    (microsoft.public.access.queries)
  • Re: Ranking function in PHP/MySQL
    ... display your ranking order you could do this: ... deathdate FROM the_table ORDER BY deathdate ... echo "$casualtyID is the number $rank casualty to die in the current ... The question was about how to do something in SQL. ...
    (comp.lang.php)

Loading