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
 

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

Similar Threads


Back
Top