join multiple tables

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

    join multiple tables

    hi..

    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,C redit 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.

    thanks.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Try using JOIN...

    Happy Coding!!!

    --- CK

    Comment

    • nbiswas
      New Member
      • May 2009
      • 149

      #3
      join multiple tables

      Hope fully this should work

      Code:
      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
      Let me know in case of any concern

      Comment

      • buterfly0707
        New Member
        • Nov 2009
        • 30

        #4
        Thanks fro your help...

        Comment

        Working...