Results 1 to 2 of 2

Thread: join

  1. #1
    Join Date
    Sep 2003

    Unanswered: join

    i am having problems with joining 2 tables using vba. the primary key is the project-id in both cases.
    table A contains the master data and has therefore more records. the date of the invoice is in table B.
    i need a query that gives me all project ids from table A and the dates where available from table B. if there is no record in table B i still want the project-id listed though with simply no value for the date.

    when i do a simple join like

    select projectID, InvoiceDate
    From tableA, tableB
    Where tableA.projectID=tableB.projectID;

    it skips the project-ids from table A if there is no record in table B.

    is there any way to solve the problem?

    Thanx :-)

  2. #2
    Join Date
    Jul 2003
    This query will return all records from tableA.
    If there is no record in tableB, then InvoiceDate will be blank.

    Select tableA.ProjectID, tableb.InvoiceDate
    FROM tableA left join tableb ON table.productid=tableb.productid
    Inspiration Through Fermentation

Posting Permissions

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