Friday, February 24, 2012

Join query not working

howz yew all
Iam in a middle of a project and iam stuck at reporting ill cut the
details it is so that i have three tables one is
"tbl_Transactions" (containing columns "Transaction_DetailID,
Transaction_Amount, Transaction_Type, Account_ID, Transaction_ID")
Transaction_Type contains CR for credit and DR for debit.
and other is
"tbl_TransactionDetails" (containing columns "Transaction_ID,
Transaction_Date")
and the third table is
"tbl_Account" (containing columns "Account_ID, Account_DateOfCreation,
Account_ParentID, Account_Name, Account_Description)
Now what iam not been able to do is that
i want to select Transaction_ID, Transaction_Date, Account_Name(for
Transaction_Type debit), Account_Name(for Transaction_Type Credit),
one debit and multiple credit entries and vice versa, iam trying to
join all tables but i dont know how to work :s can sum 1 plz help me
thnx in advance
take care
bye
Hi
> i want to select Transaction_ID, Transaction_Date, Account_Name(for
> Transaction_Type debit), Account_Name(for Transaction_Type Credit),
> one debit and multiple credit entries and vice versa, iam trying to
> join all tables but i dont know how to work :s can sum 1 plz help me
>
select * from tbl_Transactions t join tbl_TransactionDetails td on
t.Transaction_ID=td.Transaction_ID join tbl_Account ta
on ta.Account_ID=t.Account_ID
<umairsyed19@.gmail.com> wrote in message
news:c28a6557-2dfc-4efb-ad9f-c46aea287c12@.v3g2000hsc.googlegroups.com...
> howz yew all
> Iam in a middle of a project and iam stuck at reporting ill cut the
> details it is so that i have three tables one is
> "tbl_Transactions" (containing columns "Transaction_DetailID,
> Transaction_Amount, Transaction_Type, Account_ID, Transaction_ID")
> Transaction_Type contains CR for credit and DR for debit.
> and other is
> "tbl_TransactionDetails" (containing columns "Transaction_ID,
> Transaction_Date")
> and the third table is
> "tbl_Account" (containing columns "Account_ID, Account_DateOfCreation,
> Account_ParentID, Account_Name, Account_Description)
> Now what iam not been able to do is that
> i want to select Transaction_ID, Transaction_Date, Account_Name(for
> Transaction_Type debit), Account_Name(for Transaction_Type Credit),
> one debit and multiple credit entries and vice versa, iam trying to
> join all tables but i dont know how to work :s can sum 1 plz help me
> thnx in advance
> take care
> bye

No comments:

Post a Comment