Hi,
You may have a table like:
TheWeekday, ThePeriod, TheValue
2, 4, xxxx
2, 5, yyyy
....
6, 4, zzzz
....
ie, Monday (weekday=2), for the fourth period (of 3 hours, so, from 9 to
12), the value is xxx.
? DLookup("TheValue", "TableNameHere", "TheWeekday=5 AND ThePeriod = 4")
would return the value for Thursday, the fourth period.
There are other alternatives for the design, that's sure. The one I used is
only for illustration.
Hoping it may help,
Vanderghast, Access MVP
"xopher" wrote in message
...
I need to use the value in one field to determine which column in another
table needs to be used to retrieve the corresponding value. In detail, I
have a table which has different values for each time period for each day
of
the week, e.g., Monday from 9-12 has one value, Tuesday from 3-6 has
another
value, etc. resulitng in 8 values for each day for a total of 56 different
values (columns). These values are different for each record. Based on
a
time stamp, I need to identify which column I need to use for a value.
For
example, if the result of my time stamp is Friday 9-12, then I would like
to
be able to do something like - Value = Table_Name.Column (Friday 9-12),
where
Friday 9-12 is the results of my time stamp analysis. Is this possible?
I
am looking for something similar to the Indirect function in Excell. Any
help would be much appreciated.
|