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
System Process 95-100%
When opening older files in Word 2007 I get error "Word cannot start converter mswrd632". How do I solve this problem?
Importing text file into resources
SQL awkward behaviour (urgent)
insert missing deleted rows in a table from a backup
Add grid object
Microsoft SQL Server certification
TCP/IP Send/Recieve Files
stsadm.exe not found with WSS 3.0 installation
Remove Recurrence button is greyed out for outlook tasks can not delete