N
natecummins
Access Group,
I've searched around and could not find the solution to my problem
which has been bugging me for quite some time, I apologize if my
questions have been addressed before.
My MS Access knowledge is beginner to intermediate - depending on who
you compare me to I am using MS Access 2003 and all fields in
question are text fields.
Table 1 is named "Range" and contains the fields "Order", "Value Low",
and "Value High"
Table 2 is namd "List" and contains the fields "Value" and "Value
Description"
Sample data could include:
Table "Range"
Order = 1, Value Low = A, Value High = [NULL]
Order = 2, Value Low = A*, Value High = [NULL]
Order = 3, Value Low = A, Value High = C
Table "List"
Value = A1, Value Description = Sample 1
Value = A2, Value Description = Sample 2
Value = B1, Value Description = Sample 3
I have 2 scenarios which are causing me problems, scenario 1 involves
joing the two tables on the value field when it contains a wildcard
(*) character
I thought I could join the tables using the following SQL:
SELECT Range.Order, Range.[Value Low], List.Value, List.[Value
Description]
FROM Range INNER JOIN List
ON Range.[Value Low] LIKE List.Value;
However, this statement returns no results even though there is data
within the tables to provide results. I would expect the [Value Low]
field A* to match table "List" on A1 and A2.
The second scenario is extracting data from the "List" table between
the [Value Low] and [Value High] fields in the "Range" table. I am
not sure if this can be done from a query or if I need a VBA
function? Using the sample data, if [Value Low] = A and [Value High]
= C, I would like to return the [Value Descriptions] for everything A
through C from the "List" table.
I thank you in advance for any help.
I've searched around and could not find the solution to my problem
which has been bugging me for quite some time, I apologize if my
questions have been addressed before.
My MS Access knowledge is beginner to intermediate - depending on who
you compare me to I am using MS Access 2003 and all fields in
question are text fields.
Table 1 is named "Range" and contains the fields "Order", "Value Low",
and "Value High"
Table 2 is namd "List" and contains the fields "Value" and "Value
Description"
Sample data could include:
Table "Range"
Order = 1, Value Low = A, Value High = [NULL]
Order = 2, Value Low = A*, Value High = [NULL]
Order = 3, Value Low = A, Value High = C
Table "List"
Value = A1, Value Description = Sample 1
Value = A2, Value Description = Sample 2
Value = B1, Value Description = Sample 3
I have 2 scenarios which are causing me problems, scenario 1 involves
joing the two tables on the value field when it contains a wildcard
(*) character
I thought I could join the tables using the following SQL:
SELECT Range.Order, Range.[Value Low], List.Value, List.[Value
Description]
FROM Range INNER JOIN List
ON Range.[Value Low] LIKE List.Value;
However, this statement returns no results even though there is data
within the tables to provide results. I would expect the [Value Low]
field A* to match table "List" on A1 and A2.
The second scenario is extracting data from the "List" table between
the [Value Low] and [Value High] fields in the "Range" table. I am
not sure if this can be done from a query or if I need a VBA
function? Using the sample data, if [Value Low] = A and [Value High]
= C, I would like to return the [Value Descriptions] for everything A
through C from the "List" table.
I thank you in advance for any help.