connecting multiple table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buterfly0707
    New Member
    • Nov 2009
    • 30

    connecting multiple table

    hi..

    i have 4 tables. and what to some fields from each table.
    for example. i have Period , Debit and Credit fields in Gl table and Acccount field in Accounts table. i want to get the debit & credit values for selected date.

    how can i do this.

    i have written the query as follows. but this didn't came properly.it gives all the Account in Accounts table. not for selected table. don't know what was the wrong.

    <code>
    select Period,Debit,Cr edit,Account from Gl,Accounts where period='1'
    </code>

    actually i want to join all the 4 tables. but don't know how to combine this two tables. So please some one help me with this problem
    thanks.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Here, read this

    Good luck!!!

    --- CK

    Comment

    • nbiswas
      New Member
      • May 2009
      • 149

      #3
      select a.*,x.* from accounts a
      inner join
      (select g.* from gl g
      inner join Period p
      on g.Period = p.Period
      where p.Period = '01/01/2009') x
      on a.AccountLink = x.AccountLink

      Comment

      Working...