V
VJ-mike
This is probably an odd request, stemming from some
raunchy source data. here's the scoop.
TableB is 500,000 records and 35 fields - a very ugly flat
file generated from a telemetry program (POS). what I'm
trying to clean up is that field "post 2" for 1 station
(out of 60 stations) may equate to a flow value, while
field "post2" for another station may equate to pump run
hours - very bad, right?
I have a key TableA that maps each station's flow (and
other) field.
<TableA:> (greatly simplified)
Station: FlowField: TankLevel: PumpRun:
"bismark" "post1" "post2" "post3"
"alder" "post2" "post3" "post33"
and so on for 60 stations...
so if I run a query for the FlowField of Alder the result
is "post2".
Now, <TableB>
Date: Station: Post1: Post2: Post3: (and so on)
"01/01/04" "bismark" "4200" "21.2" "2.2"
"01/02/04" "bismark" "4300" "21.1" "2.5"
"01/01/04" "alder" "" "2472" "x"
"01/02/04" "alder" "" "1356" "x"
and so on, 9000 records for each of 60 stations.
OK, now from the previous query, I know that the FlowField
of Alder the result is "post2".
The tricky part is how to put the correct FlowField
into a new query grid... Is it post1, post2, etc? we know
from the previous Query that we need "post2".
So in a new query grid where TableA is linked to TableB
via the Station fields in each, I request the:
Date: Station: Post2:
criteria-"alder"
the results would be:
"01/01/04" "alder" "2472"
"01/02/04" "alder" "1356"
I want that last field name(object, or whatever you call
it!) to come from the previous query, not look it up and
type it manually. maybe that doesn't seem like extra work
to some folks, but I thought it would serve as an
opportunity to learn something. Perhaps this can only
happen with a macro or VB.
If I could also get the station name ("alder") from the
pre-query as well, that'd be even better.
thanks,
mike.
raunchy source data. here's the scoop.
TableB is 500,000 records and 35 fields - a very ugly flat
file generated from a telemetry program (POS). what I'm
trying to clean up is that field "post 2" for 1 station
(out of 60 stations) may equate to a flow value, while
field "post2" for another station may equate to pump run
hours - very bad, right?
I have a key TableA that maps each station's flow (and
other) field.
<TableA:> (greatly simplified)
Station: FlowField: TankLevel: PumpRun:
"bismark" "post1" "post2" "post3"
"alder" "post2" "post3" "post33"
and so on for 60 stations...
so if I run a query for the FlowField of Alder the result
is "post2".
Now, <TableB>
Date: Station: Post1: Post2: Post3: (and so on)
"01/01/04" "bismark" "4200" "21.2" "2.2"
"01/02/04" "bismark" "4300" "21.1" "2.5"
"01/01/04" "alder" "" "2472" "x"
"01/02/04" "alder" "" "1356" "x"
and so on, 9000 records for each of 60 stations.
OK, now from the previous query, I know that the FlowField
of Alder the result is "post2".
The tricky part is how to put the correct FlowField
into a new query grid... Is it post1, post2, etc? we know
from the previous Query that we need "post2".
So in a new query grid where TableA is linked to TableB
via the Station fields in each, I request the:
Date: Station: Post2:
criteria-"alder"
the results would be:
"01/01/04" "alder" "2472"
"01/02/04" "alder" "1356"
I want that last field name(object, or whatever you call
it!) to come from the previous query, not look it up and
type it manually. maybe that doesn't seem like extra work
to some folks, but I thought it would serve as an
opportunity to learn something. Perhaps this can only
happen with a macro or VB.
If I could also get the station name ("alder") from the
pre-query as well, that'd be even better.
thanks,
mike.