query problem (1 Viewer)

parara

Registered User.
Local time
Today, 14:24
Joined
Oct 15, 2007
Messages
16
Hi to anybody ,
here is my problem.
I have 3 tables ,
t1 with fields (t1ID , orderID , custID , date , amount , logID)
t2 with fields (t2ID , orderID , mesiID , date , amount , logID)
t3 with fields (t3ID , orderID , driveID , date , amount , logID)

I am trying to create a query with following info

from t1 custID , date , amount , logID
from t2 mesiID , date , amount , logID
from t3 driveID , date , amount , logID

I want to have only a query with above info by row , for example



date , custID , amount , logID , orderID
date , mesiID , amount , logID , orderID
date , driveID , amount , logID , orderID
....
....
...
...
date , custID , amount , logID


the fields , date , amount , logID maby are the same on some records
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:24
Joined
Jan 23, 2006
Messages
15,379
Why do the three tables all have the same structure?
Why nit just 1 table?

Look up UNION query.
 

parara

Registered User.
Local time
Today, 14:24
Joined
Oct 15, 2007
Messages
16
OK. I have 3 tables because ,
i have 1 order. For this order i must pay my supplier , the driver , and the person who make the sale.

So , i am using 1 table for supplier payment , 1 table for drivers and 1 for sales-man. When i pay , i use different bank-account . Each bank-account can be pay a supplier , or driver or sale-man ... or both of them. I want to control these bank-accounts so i thought to create a query from three tables and then filtering it with bank-account ID.
 

Users who are viewing this thread

Top Bottom