Query Question

C

Correy

I have three tables I'm trying to query.

Table 1 - Employees
Table 2 - Cell Phones
Table 3 - Pagers

And what I'm trying to do is query ALL of the employees in Table 1 and show
either their pager number or cell phone number or still list them even if
both those fields are Null.

Can someone help point me in the right direction. Everytime I try to
run/create my own query I just get the employees that have both a cell and a
pager.
Any information would be greatly appreciated.

Thanks, Correy
 
K

KARL DEWEY

SELECT IIF([Cell Phones].[Number] Is Not Null, [Cell Phones].[Number],
[Pagers].[Number] AS Contact
FROM ([Employees] LEFT JOIN [Cell Phones] ON [Employees] .[ID] = [Cell
Phones].EmployeeID]) ([Employees] LEFT JOIN [Pagers] ON [Employees] .[ID] =
[Pagers].EmployeeID]) ;
 
C

Correy

Ahh...I think that might work.

Thanks!!

KARL DEWEY said:
SELECT IIF([Cell Phones].[Number] Is Not Null, [Cell Phones].[Number],
[Pagers].[Number] AS Contact
FROM ([Employees] LEFT JOIN [Cell Phones] ON [Employees] .[ID] = [Cell
Phones].EmployeeID]) ([Employees] LEFT JOIN [Pagers] ON [Employees] .[ID]
=
[Pagers].EmployeeID]) ;


--
KARL DEWEY
Build a little - Test a little


Correy said:
I have three tables I'm trying to query.

Table 1 - Employees
Table 2 - Cell Phones
Table 3 - Pagers

And what I'm trying to do is query ALL of the employees in Table 1 and
show
either their pager number or cell phone number or still list them even if
both those fields are Null.

Can someone help point me in the right direction. Everytime I try to
run/create my own query I just get the employees that have both a cell
and a
pager.
Any information would be greatly appreciated.

Thanks, Correy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top