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
MFC CString - valid IP Address ?
Resize forms using the ADHresize2k gives form FLICKER
hauppage 1212 and xbox 360. windows 7 pc
Has anyone run these scripts
Want to remove extra numerical information (zip codes, etc.) from a text file that has thousands of addresses to only leave a 10-digit phone number (area code + phone number)?
Export Access Report(S) to Section(S) in Word
IEENCODE.DLL.000
SQL Insert Given Date Range
How do you count the number of folders in an Exchange 2007 mailbox?
event id 1639 warning message on blackberry server