M
Mike D via AccessMonster.com
Greetings and thanks for taking the time to read this post.
I am trying to create a query in access (2003) that will return the record
when at least 13 firefighters get on to a fire scene.
The data that is returned from my query qryEffectiveForce is shown below:
Incident # / Response Time (secs) / At Scene Time / Unit / # of FFs
1000 100 13:12:00 engine 4
1000 120 13:12:20 rescue 2
1000 130 13:12:30 engine 4
1000 160 13:13:00 ladder 4
1000 180 13:13:20 engine 4
1000 190 13:13:30 chief 1
With this example then I’d like the record with the ladder’s data to be
returned.
The problem is that 13 could be arrived at by any number of combinations
including 2 rescues, and three engines 2, or 2 engines, 2 rescues, and a
chief. These combinations prohibit me from always querying for the time of
the fourth unit or something like that.
qryEffectiveForce - is sorted by IncidentNumber and ATST (which at least puts
the units arrival sequence in order) and returns the following fields:
Incident Number
ETAS (Response Time in seconds)
ATST (At scene time “hh:nn:ssâ€)
Unit (type)
Personnel (# of FFs)
My question is can I do this in the query designer or is this a vb query
either way I would truly appreciate some insight as to the right direction.
My biggest obstacle with the vb code is determining how to write code that
says for each IncidentNumber count Personnel until Personnel >= 13 return
this record and move to the next incident. I know I am taking a risk by not
displaying any code, but this query is driving me nuts and I can't get a
handle on it. It is not that I havn't tried.
Thanks, Mike
I am trying to create a query in access (2003) that will return the record
when at least 13 firefighters get on to a fire scene.
The data that is returned from my query qryEffectiveForce is shown below:
Incident # / Response Time (secs) / At Scene Time / Unit / # of FFs
1000 100 13:12:00 engine 4
1000 120 13:12:20 rescue 2
1000 130 13:12:30 engine 4
1000 160 13:13:00 ladder 4
1000 180 13:13:20 engine 4
1000 190 13:13:30 chief 1
With this example then I’d like the record with the ladder’s data to be
returned.
The problem is that 13 could be arrived at by any number of combinations
including 2 rescues, and three engines 2, or 2 engines, 2 rescues, and a
chief. These combinations prohibit me from always querying for the time of
the fourth unit or something like that.
qryEffectiveForce - is sorted by IncidentNumber and ATST (which at least puts
the units arrival sequence in order) and returns the following fields:
Incident Number
ETAS (Response Time in seconds)
ATST (At scene time “hh:nn:ssâ€)
Unit (type)
Personnel (# of FFs)
My question is can I do this in the query designer or is this a vb query
either way I would truly appreciate some insight as to the right direction.
My biggest obstacle with the vb code is determining how to write code that
says for each IncidentNumber count Personnel until Personnel >= 13 return
this record and move to the next incident. I know I am taking a risk by not
displaying any code, but this query is driving me nuts and I can't get a
handle on it. It is not that I havn't tried.
Thanks, Mike