Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2016
    Location
    Chatsworth, GA (Northwest corner of state)
    Posts
    23

    Need a query with join

    I have a simple database with 2 tables. a) Florist, a list of purchasers of items and b) Fldetail, the lists of items purchased by one or more of the purchasers.

    The Main form is called Invoice and contains all of the purchaser information as well as various text fields with some static information. The SubForm ReportFldetail contains information about individual purchases for each
    purhaser.

    Queries are created on both Florist and Fldetail to fill in the main form and the subform. The two forms are linked with an ID field.

    So far, everything works perfectly, and all of the information I want is presented correctly for each purchaser.


    The problem that I have been unable to solve is that the report gives a record for every purchaser in the database including those who have not purchased anything. I have tried everything I have come across to
    eliminate these unwanted records, but have had no luck.

    I am thinking that the solution could be done by creating the combined tables with a join, but have not been able to do anything with this.

    Any suggestions would be greatly appreciated.

    David Wright Sr.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If I understand correctly, your tables are like this (I know I am missing a lot of fields):
    Click image for larger version. 

Name:	Florist1.jpg 
Views:	11 
Size:	10.7 KB 
ID:	27070
    In the query design, double click on the joining line and select option 3:
    "Include All records from 'Fldetail' and only those records from 'Florist' where the joined fields are equal"

    The SQL will look something like:
    Code:
    SELECT Florist.PurchaserName, Fldetail.purchaseItem
    FROM Florist RIGHT JOIN Fldetail ON Florist.FloristID_PK = Fldetail.FloristID_FK;

  3. #3
    Join Date
    Oct 2016
    Location
    Chatsworth, GA (Northwest corner of state)
    Posts
    23
    Thanks. I was able to fix the output by using and modifying your select statement once for the main form and once for the subform. Worked beautifully.

    David Wright Sr.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Excellent! Good luck with your project....

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

Similar Threads

  1. Join Query Help
    By newbieaccess203 in forum Queries
    Replies: 4
    Last Post: 01-12-2016, 02:25 PM
  2. Join Query?
    By KWarzala in forum Forms
    Replies: 5
    Last Post: 07-29-2014, 02:44 PM
  3. Replies: 6
    Last Post: 11-19-2013, 01:38 AM
  4. Help with a join query
    By abordeau in forum Queries
    Replies: 7
    Last Post: 10-03-2013, 11:51 AM
  5. Inner join query not quite right
    By coach32 in forum Queries
    Replies: 6
    Last Post: 07-07-2012, 03:13 AM

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