By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,574 Members | 1,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,574 IT Pros & Developers. It's quick & easy.

join multiple tables

P: 30

i have 3 tables. and the field discription is in Accounts table Account. and GL table fields are Debit, Credit and Period. And in Period Table Period and Date. this are nt only fields in this tables but per my questions this fields are necessary.

The LInk Between The tables are: In Accounts table AccountLink is Primary key and in GL Table It is Foriegn key. And in Period table i have Date and acording to that there is number for Period Field. And i have same value in GL table as Period(the field name).

My problem is i want to get the Account,Debit,Credit values for the perticular (date which is in Period Table).

this is realy confusing. and i dont know the way to do this. if someone can help me with this it will be a grate help.

Dec 10 '09 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 2,878
Try using JOIN...

Happy Coding!!!

--- CK
Dec 10 '09 #2

P: 149
Hope fully this should work

Expand|Select|Wrap|Line Numbers
  1. select a.*,x.* from accounts a
  2. inner join 
  3. (select g.* from gl g
  4. inner join Period  p
  5. on g.Period  = p.Period 
  6. where p.Period  = '01/01/2009') x
  7. on a.AccountLink = x.AccountLink
Let me know in case of any concern
Dec 11 '09 #3

P: 30
Thanks fro your help...
Dec 11 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.