JGalletta
Windows 7 Access 2010
- Local time
- Today, 04:11
- Joined
- Feb 9, 2012
- Messages
- 149
Id like to find the count of consecutive like values in set of records:
In recording pesticide applications, each chemical has a type and a group number. The type can either be pesticide fungicide or herbicide (simple for this example) and the group can range from 1-5 (also dumbed down). I'd like to be able to count (for each type) the amount of consecutive records with the same group number. So if I record the following data:
Pesticide, 2
Pesticide, 2
Herbicide, 2
Pesticide, 2
The amount of consecutive pesticide type 2 records is 3.
Also if I record the following:
Pesticide,2
Pesticide,3
Pesticide,2
Pesticide,2
The amount of consecutive pesticide type 2 records is 2.
And for these:
Pesticide, 2
Herbicide, 3
Fungicide, 4
Pesticide, 2
The amount of consecutive pesticide type 2 records is 2.
How can I acquire these values using vba or sql methods? - I only want one value for each set of criteria (type,group) that I inquire about.
I hope someone can understand what I'm trying to ask here. Feel free to ask for more details, I'll be back here after my lunch nap (1hr from now).
Thanks in advance,
John
In recording pesticide applications, each chemical has a type and a group number. The type can either be pesticide fungicide or herbicide (simple for this example) and the group can range from 1-5 (also dumbed down). I'd like to be able to count (for each type) the amount of consecutive records with the same group number. So if I record the following data:
Pesticide, 2
Pesticide, 2
Herbicide, 2
Pesticide, 2
The amount of consecutive pesticide type 2 records is 3.
Also if I record the following:
Pesticide,2
Pesticide,3
Pesticide,2
Pesticide,2
The amount of consecutive pesticide type 2 records is 2.
And for these:
Pesticide, 2
Herbicide, 3
Fungicide, 4
Pesticide, 2
The amount of consecutive pesticide type 2 records is 2.
How can I acquire these values using vba or sql methods? - I only want one value for each set of criteria (type,group) that I inquire about.
I hope someone can understand what I'm trying to ask here. Feel free to ask for more details, I'll be back here after my lunch nap (1hr from now).
Thanks in advance,
John