Microsoft
Software
Hardware
Network
Question : Group and Count consecutive numbers in an Access dataset
I have a dataset where I need to count the occurance of consecutive numbers. The challenge is that the same number can show up throughout the dataset, so you can't do a simple group by and count. Each row has a unique row ID that increments by 1.
It is simple to do in Excel with row+1 formulas, but in a database it has been tuff. I have been able to get close by joining the table to itself on the Unique ID +/- 1 to get the previous and next day values in one record, however that does not solve my objective of getting a count of consecutive values when the same value can show up more than once in separate places.
Here is a subset of the data:
ID COBDate Name Value
821902 11/27/06 Series1 7.008571667
821903 11/28/06 Series1 7.008571667
821904 11/29/06 Series1 7.008571667
821905 11/30/06 Series1 7.007347143
821906 12/01/06 Series1 7.008571667
821907 12/04/06 Series1 7.008571667
821908 12/05/06 Series1 7.008571667
should result in:
Count 1: 7.008571667 = 3
Count 2: 7.007347143 = 1
Count 3: 7.008571667 = 3
Also attached is an excel file to import to Access for testing.
Answer : Group and Count consecutive numbers in an Access dataset
Rereading, my WHERE clause is mixed up. Replace this line:
Where B.Value<>A.Value And B.ID
(°v°)
Random Solutions
What would the SQL command be to remove "blank" lines from a block of text?
Accessing postgresql c#
How to Install Windows Server 2008 OS on Dell PowerEdge 2800
Retrieving just the first instance of each customer using SQL
Help Using RtlMoveMemory from kernel32 in VB.NET
Datasheet view and drilldown
Access / VBA / return to previous record after form after update event triggers
Send/Receive error in Outlook when Sharepoint Discussion Boards/Doc Libraries connected to it
File Sharing Lock w/single user
Cannot extract bitmap from resources section of app!