Values from different tables

evanhughes

Registered User.
Local time
Today, 00:10
Joined
Nov 26, 2009
Messages
46
Happy Holidays All

Todays problem is as follows:

Table 1 field 1 has data like A1 or A2 or A3 etc.
Table 2 will have 3 field
A1 Left Up
A2 Left Down
A3 Right Up

What I need is if the query runs and the value from Table 1 = A2
then I need the query to display the equivelant value from Table 2 field 2 = Left

I hope you can understand my scribble as I have found it hard to explain.

Basicaly when I need it to display values from a different table when run.

Evan
 
If i have read your question correctly this should allow you to query one table from the results from another.

SELECT field2
FROM table2
WHERE (((table2.field1) in (SELECT field1 FROM table1
WHERE enter where statement here for first query)));

 
I would be in favour of an INNER JOIN as opposed to the IN operator.

Drop the two tables onto the query designer, drag field1 from table1 onto field1 of table2, i.e. the fields that contain A1, A2 ...etc. That will help automatically create the inner join.
 

Users who are viewing this thread

Back
Top Bottom