Hi all
I have been searching for a solution to this but can't find anything.
This thread is the closest I have found but I need advice on how to build the arrays, if that is the way to do it.
http://www.access-programmers.co.uk/forums/showthread.php?t=188959&highlight=sumproduct
Anyway, from the start.
In excel I have this formula
=SUMPRODUCT(($A$2:$A$11=$A2)*($B$2:$B$11<$B2))+1.
I have attached a small sample that shows what I'm after, and also a sample db just with the same data and my attempt from point 1 below.
I want to do the exact same thing in access, with exactly the same data.
1, Can this be achieved in a query. I was thinking something along the lines of a count(SELECT) statement. (My poor attempt is in the attached file).
2, If I do this in VBA, can I put an entire column in an array at once or do I have to build the array with a record set. I presume I would then write the result back into the table.
Look forward to your responses.
Thanks
p.s. you will also see in the sample file a couple of other formulas that work providing the time is in ascending order.I can use either =COUNTIF($F$2:$F2,$F2) or =IF($F2=$F1,$I1+1,1).
I have been searching for a solution to this but can't find anything.
This thread is the closest I have found but I need advice on how to build the arrays, if that is the way to do it.
http://www.access-programmers.co.uk/forums/showthread.php?t=188959&highlight=sumproduct
Anyway, from the start.

In excel I have this formula
=SUMPRODUCT(($A$2:$A$11=$A2)*($B$2:$B$11<$B2))+1.
I have attached a small sample that shows what I'm after, and also a sample db just with the same data and my attempt from point 1 below.
I want to do the exact same thing in access, with exactly the same data.
1, Can this be achieved in a query. I was thinking something along the lines of a count(SELECT) statement. (My poor attempt is in the attached file).
2, If I do this in VBA, can I put an entire column in an array at once or do I have to build the array with a record set. I presume I would then write the result back into the table.
Look forward to your responses.
Thanks
p.s. you will also see in the sample file a couple of other formulas that work providing the time is in ascending order.I can use either =COUNTIF($F$2:$F2,$F2) or =IF($F2=$F1,$I1+1,1).