not getting all recs for outer join

  • Thread starter Thread starter njp
  • Start date Start date
N

njp

BlankI'm only getting 2 records where P.Timeslot = T.Timeslot. I'm not getting all 12 records from T.Timeslot regardless if P.Timeslot matches or not. I'm stumped. Is there something special to specify for the table, fields, relationship? I've tried everything I can think of and am now stuck. BTW, if P.Timeslot is not Null everything is ok. When it's null I have the problem.

Here's the query:

SELECT P.Rate, P.PortID, P.TerminalID, P.ModemID, T.Timeslot
FROM tblPort AS P RIGHT JOIN tblTimeslot AS T ON P.Timeslot=T.Timeslot
WHERE (((P.TerminalID)=184))
ORDER BY Int(T.Timeslot);
Thanks,

NJ
 
If you want 12 rows for each combination of P.Rate, P.PortID, P.TerminalID,
P.ModemID, try something like

SELECT P.Rate, P.PortID, P.TerminalID, P.ModemID, T.Timeslot
FROM
(SELECT DISTINCT P.Rate, P.PortID, P.TerminalID, P.ModemID
FROM tblPort
WHERE TerminalID=184) AS P,
tblTimeslot AS T
ORDER BY Int(T.Timeslot);

Hope This Helps
Gerald Stanley MCSD
 
Back
Top