joining 2 tables

R

Rashesh\(H\)

hi,

I create a 2 tabels, 1.master, 2.tran(trasaction).

1.master tabels column are(code,name,type,cur_bal)
type=1 -> bank infomation
type=2 -> party information
type=3 -> account information
2.tran tables column are(date,cr_cd,amount,db_cd,des1,des2,des3)

now, I do query "SELECT date,cr_cd,master.name,amount,des1 FROM tran INNER
JOIN master ON master.code = tran.cr_cd;" this query complete run.In tran
table cr_cd(infromation comes master table.bank), db_cd(infromation comes
master tabels.paty), I write a query "SELECT
date,cr_cd,master.name,amount,des1,db_cd,mst.name FROM tran INNER JOIN
master ON master.code = tran.cr_cd INNER JOIN master AS mst ON mst.code =
tran.db_cd;", I do but error comes.

I think this my mistek in query (syntex, other method to write).

Regards,
Rashesh
 
J

John Spencer (MVP)

Access REQUIRES parentheses in the FROM clause whenever more than two tables are
involved. Also a fieldname of Date is a bit dangerous since Date is a function.
I would either rename the field, fully qualify it with the table name, or use
square brackets [] around the field name.

SELECT tran.[date],cr_cd,master.name,amount,des1,db_cd,mst.name
FROM (tran INNER JOIN master
ON master.code = tran.cr_cd)
INNER JOIN master AS mst
 
Top