Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    Saudi Arabia
    Posts
    9

    Unanswered: table combination of two tables

    How can I create time table or a query combination of two time tables with different irregular time frequencies?

    Table1 (Test1)

    Well Date Test1
    A123 1/1/2003 ABC
    A123 5/1/2003 DCF
    A123 9/1/2003 RRR
    A124 7/1/2003 ABC




    Table2 (Test2)

    Well Date Test2
    A123 2/1/2003 NNN
    A123 3/1/2003 FFF
    A123 9/1/2003 TTT
    A124 1/1/2003 VVV



    Table 3 Tests

    Well Date Test1 Test2
    A123 1/1/2003 ABC ......
    A123 2/1/2003 .... NNN
    A123 3/1/2003 .... FFF
    A123 5/1/2003 DCF .....
    A123 9/1/2003 RRR TTT
    A124 7/1/2003 ABC .....
    A124 1/1/2003 ..... VVV

  2. #2
    Join Date
    Feb 2004
    Posts
    137
    Try this query:

    SELECT DISTINCTROW Table1.Well, Table1.Date, Table1.Test1, Nz(Table2.Test2,'...') AS Test2
    FROM Table1 LEFT JOIN Table2 ON (Table1.Well = Table2.Well) AND (Table1.Date = Table2.Date);

    UNION SELECT DISTINCTROW Table2.Well, Table2.Date, Nz(Table1.Test1,'...'), Table2.Test2
    FROM Table1 RIGHT JOIN Table2 ON (Table1.Well = Table2.Well) AND (Table1.Date = Table2.Date);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •