Query Question

  • Thread starter Thread starter Correy
  • Start date Start date
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
 
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]) ;
 
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
 
Back
Top