Results 1 to 3 of 3
  1. #1
    Stephenson is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    North West
    Posts
    110

    Two tables needed to produce one report

    Hello all,



    I have two tables, EmployeeWorkLog and VendorPurchaseLog. I have forms to input data into these tables and need to pull a report to show fields from each of them. They share the fields, JobID, ServiceID and Date. I've tried queries, but am still learning how to create them. There will be many circumstances where there will not be any records in my table VendorPurchaseLog when there are records in table EmployeeWorkLog. This alone has me confused.

    How can I create a report that shows records for two tables with overlapping fields even when there may be "null" results in the other?

    Thank you for having a look.

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    in a query use a LEFT JOIN between the table which 'always has the records' and the table that doesn't

    SELECT *
    FROM EmployeeWorkLog LEFT JOIN VendorPurchaseLog ON EmployeeWorkLog.jobID =VendorPurchaseLog.jobID AND EmployeeWorkLog.ServiceID =VendorPurchaseLog.ServiceID AND EmployeeWorkLog.jobDate =VendorPurchaseLog.jobDate

    Note - Date is a reserved word so if your tables use this as a field name, I strongly recommend changing it

    Alternatively use a right between the table that doesn't and the table that does

    SELECT *
    FROM VendorPurchaseLog RIGHT JOIN EmployeeWorkLog ......

  3. #3
    Stephenson is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2015
    Location
    North West
    Posts
    110
    Thank you Ajax.

    This works great. I appreciate your help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 03-05-2015, 07:33 PM
  2. How to produce single entry report?
    By basils57 in forum Access
    Replies: 2
    Last Post: 03-09-2013, 04:57 PM
  3. Produce report after appending records?
    By Astron2012 in forum Access
    Replies: 14
    Last Post: 02-20-2013, 08:40 AM
  4. Replies: 0
    Last Post: 03-30-2011, 09:50 AM
  5. Replies: 1
    Last Post: 12-21-2010, 09:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums