D
Drodway
Hi
Im fairly new to all this so please bear with me - and forgive me if there
is a simple solution
i have a database with nine tables:
pk = primary key, fk = foreign key
deal (pk = d_id)(fk = V_LU=vehicle.v_id, C_LU=customer.c_id,
S_LU=supplier.s_id, SM_LU=salesman.s_id, F_LU=finance.f_id)
vehicle (pk = v_id)
customer (pk = c_id)
supplier (pk = s_id)
salesman (pk = sm_id)
finance (pk = f_id)
payments (pk = p_id)(fk = p_d_id=deal.d_id)
payments made (pk = pm_id)(fk = pm_d_id=deal.d_id)
additions (pk = a_id)(fk = a_id=deal.d_id)
basically i can add all details from a form and all information is stored
correctly (as far as im aware)
i wish to extract all data using the customer.c_id field to withdraw all
information.
When i come to running the query (below) i simply get no results returned?
SELECT deal.[D_Id], customer.Cust_Id, additions.Description,
additions.Supplier, additions.Date_, additions.Cost, payments.[Source:],
payments.[Date:], payments.[Method:], payments.[Amount:],
payments_made.Date_, payments_made.Method, payments_made.[Cheque No],
payments_made.Amount, vehicle.V_Type, vehicle.V_Reg, vehicle.V_Make,
vehicle.V_Model, vehicle.V_Derv, vehicle.V_Mileage, vehicle.V_Colour,
vehicle.V_History, vehicle.V_Fuel, vehicle.V_DOR, vehicle.V_Radio,
vehicle.V_Key, vehicle.V_Chassis, vehicle.V_Dr, vehicle.V_typeV
FROM vehicle INNER JOIN (supplier INNER JOIN (salesman INNER JOIN (((finance
INNER JOIN (customer INNER JOIN (deal INNER JOIN additions ON deal.D_Id =
additions.a_d_id) ON customer.Cust_Id = deal.C_LU) ON finance.F_Id =
deal.F_LU) INNER JOIN payments ON deal.D_Id = payments.p_d_id) INNER JOIN
payments_made ON deal.D_Id = payments_made.pm_d_id) ON salesman.SM_Id =
deal.SM_LU) ON supplier.S_Id = deal.S_LU) ON vehicle.V_Id = deal.V_LU
WHERE (((customer.Cust_Id)=3));
(i have also tried running the query without any criteria and still got no
results - i have checked that there is data stored in the tables)
Is there an error with my Select Statement? have i constructed my
relationships/primary or foreign keys incorrectly?
Any help or pointers would be greatly appreciated!
If you require any other details please let me know!
Regards
Daniel
Im fairly new to all this so please bear with me - and forgive me if there
is a simple solution
i have a database with nine tables:
pk = primary key, fk = foreign key
deal (pk = d_id)(fk = V_LU=vehicle.v_id, C_LU=customer.c_id,
S_LU=supplier.s_id, SM_LU=salesman.s_id, F_LU=finance.f_id)
vehicle (pk = v_id)
customer (pk = c_id)
supplier (pk = s_id)
salesman (pk = sm_id)
finance (pk = f_id)
payments (pk = p_id)(fk = p_d_id=deal.d_id)
payments made (pk = pm_id)(fk = pm_d_id=deal.d_id)
additions (pk = a_id)(fk = a_id=deal.d_id)
basically i can add all details from a form and all information is stored
correctly (as far as im aware)
i wish to extract all data using the customer.c_id field to withdraw all
information.
When i come to running the query (below) i simply get no results returned?
SELECT deal.[D_Id], customer.Cust_Id, additions.Description,
additions.Supplier, additions.Date_, additions.Cost, payments.[Source:],
payments.[Date:], payments.[Method:], payments.[Amount:],
payments_made.Date_, payments_made.Method, payments_made.[Cheque No],
payments_made.Amount, vehicle.V_Type, vehicle.V_Reg, vehicle.V_Make,
vehicle.V_Model, vehicle.V_Derv, vehicle.V_Mileage, vehicle.V_Colour,
vehicle.V_History, vehicle.V_Fuel, vehicle.V_DOR, vehicle.V_Radio,
vehicle.V_Key, vehicle.V_Chassis, vehicle.V_Dr, vehicle.V_typeV
FROM vehicle INNER JOIN (supplier INNER JOIN (salesman INNER JOIN (((finance
INNER JOIN (customer INNER JOIN (deal INNER JOIN additions ON deal.D_Id =
additions.a_d_id) ON customer.Cust_Id = deal.C_LU) ON finance.F_Id =
deal.F_LU) INNER JOIN payments ON deal.D_Id = payments.p_d_id) INNER JOIN
payments_made ON deal.D_Id = payments_made.pm_d_id) ON salesman.SM_Id =
deal.SM_LU) ON supplier.S_Id = deal.S_LU) ON vehicle.V_Id = deal.V_LU
WHERE (((customer.Cust_Id)=3));
(i have also tried running the query without any criteria and still got no
results - i have checked that there is data stored in the tables)
Is there an error with my Select Statement? have i constructed my
relationships/primary or foreign keys incorrectly?
Any help or pointers would be greatly appreciated!
If you require any other details please let me know!
Regards
Daniel