Make sure your Running Total Reset is set to "Never".
It should be a distinctCount of the InmateID. It will incriment by 1 everytime it finds an new 'Out' row for a unique inmate that has
the OUt row date <param and the next row (in) >param (these colored examples below) or an inmate that has a row out with a date < param and the next row is for a new inmate (these colored examples below)
You need not be worried about counting ROWS, you need to be worried about counting Inmates.
Using a Param of 2-5-10 some fake data should be something like
Inmate Before_V After_V Date Running Total
Inmate 1 0 1 1-22-10 0
Inmate 1 1 0 1-23-10 0
Inmate 1 0 1 2-4-10 1
Inmate 1 1 0 2-6-10 1 (repeated)
Inmate 2 0 1 1-5-10 2
Inmate 3 0 1 1-27-10 2 (repeated)
Inmate 3 1 0 1-29-10 2 (repeated)
Inmate 4 0 1 1-27-10 3
Inmate 4 1 0 2-12-10 3 (repeated)
Inmate 5 0 1 1-4-10 3 (repeated)
Inmate 5 1 0 1-8-10 3 (repeated)
Inmate 5 0 1 2-1-10 4
Note in the lines that are noted with (repeated) are showing that the RT ignored them as they donot meet the criteria but will still have the previous RT value since is is at Reset=NEver.
Does this make sense?
Edited by DBlank - 24 Feb 2010 at 3:06pm