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
ranking records and determining percentage of total in access 2007
Infinite loop when Range is only 1 cell
outlook 2000 "TCP/IP connection was unexpectedly terminated by your mail server. If this problem persists, contact your LAN
Report Group Subtotals and Total
Read structure from binary file
MS ACCESS CODE PROBLEM - Can't assign a value to this object
Grouping Question
Advice needed for internet-only machine
Windows Mail on Vista to Outlook 2007 on Windows 7
Determine which table and columns a field is stored at the backend