Indexing 2 sides of a relationship

N

NPell

I have a table which to all intent and purposes is:
Recieved and Sent.

I have a table which has:
Rec. Date >> Sent Date
(with other information, but i can manage that)

I want a query to show :

Date >> Recieved >> Sent.

But on some days there might not be any entries for Sent or Received.
This would be fine if i can guraentee that one will be done each day.

However some days we might get alot in, so we would spend all day
logging the Recieved info.
Then other days we might have a backlog of stuff, so would not log an
Rec'd but only sort out Sending info.

How can i make sure ALL dates are picked up via a query?

Really appreciate any help..
Kind Regards,
 
N

NPell

I have a table which to all intent and purposes is:
Recieved and Sent.

I have a table which has:
Rec. Date >> Sent Date
(with other information, but i can manage that)

I want a query to show :

Date >> Recieved >> Sent.

But on some days there might not be any entries for Sent or Received.
This would be fine if i can guraentee that one will be done each day.

However some days we might get alot in, so we would spend all day
logging the Recieved info.
Then other days we might have a backlog of stuff, so would not log an
Rec'd but only sort out Sending info.

How can i make sure ALL dates are picked up via a query?

Really appreciate any help..
Kind Regards,

Date Received Sent
01/01/2010 30 83
02/01/2010 88 0
03/01/2010 91 0
04/01/2010 0 29
05/01/2010 0 71
06/01/2010 95 64
07/01/2010 18 37

If anyone was struggling to picture what i mean.
The above is what im striving for.
But if i only use the date from Recieved if it appears, then i will
miss 4th and 5th, as it is null (showing as zero).
Same applies for Sent, i would miss 2nd and 3rd, as it is null
(showing as zero).

Hope this helps, if it was needed.
 
J

Jerry Whittle

Access does not support full outer joins in a query.

What you could do is a Left Join (#2 if you double click on the join line in
the query). That would get the Receives even if there isn't a Sent. Then
create a similar query except using the Right Join option (#3) to get the
records the other way.

Next join these two queries in a Union query.

Select * From Query1
Union
Select * From Query2;

Using Union (instead of Union All) will get rid of any duplicates.
 
N

NPell

Access does not support full outer joins in a query.

What you could do is a Left Join (#2 if you double click on the join line in
the query). That would get the Receives even if there isn't a Sent. Then
create a similar query except using the Right Join option (#3) to get the
records the other way.

Next join these two queries in a Union query.

Select * From Query1
Union
Select * From Query2;

Using Union (instead of Union All) will get rid of any duplicates.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.












- Show quoted text -

Perfect. Thankyou so much.
 

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