>i have three table
>
>TB_GLTRANS (id int,origin c(20),acc_per int,acc_year int) , TB_GLTRANSD (id int,idaccount int,mnt_cre n(8,2),mnt_deb n(8,2)) and i got the account table TB_GLACCOUNT(id int,accountno c(10))
>
>I want to make a select but im not sure how to do it. For the result i want all the account with all the transaction(TB_GLTRANSD) for a determined acc_per and acc_year. So a account who does have a transaction i want to see it in the list.
>
>So the result must be TB_GLACCOUNT.id,TB_GLACCOUNT.accountno,TB_GLTRANS.id,TB_GLTRANS.acc_per,TB_GLTRANS.acc_year,
>TB_GLTRANSD.MNT_CRE,TB_GLTRANSD.mnt_deb
>
>Thanks you
Your tables' fields are not very clear. Anyway might be like:
select ;
TB_GLACCOUNT.id,TB_GLACCOUNT.accountno,TB_GLTRANS.id,;
TB_GLTRANS.acc_per,TB_GLTRANS.acc_year, ;
TB_GLTRANSD.MNT_CRE,TB_GLTRANSD.mnt_deb ;
from TB_GLACCOUNT ;
inner join TB_GLTRANSD on TB_GLACCOUNT.id = TB_GLTRANSD.idaccount ;
inner join TB_GLTRANS on TB_GLTRANSD.id = TB_GLTRANS.id ;
where TB_GLTRANS.acc_per == < per value > and ;
TB_GLTRANS.acc_year == < year value >
Cetin