Results 1 to 6 of 6
  1. #1
    Sam11420 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2015
    Posts
    9

    multiple table queries

    PLEASE HELP ITS URGENT
    i created a query using 5 different tables all tables are linked to table1
    1 person can have more than 1 qualification and more than 1 different type of exp and more that 1 industry exp and only 1 medical exp date
    table1
    surname
    name

    table2 -
    qualification
    expiry date

    table3
    type of exp

    table4
    industry exp
    yrs of exp

    when i run the query all the information show as it should BUT the problem is information is duplicated like:
    Smith Joe PT1 NDT exp 4 yrs FAC 16/01/2016


    Smith Joe MT2 Insp exp 1 yr DB 16/01/2016
    Smith Joe PT1 NDT exp 4 yrs LB 16/01/2016

    If say for instance the employee has 4 qualifications everything is repeated, how do I get my query to look like this
    Smith Joe PT1 NDT exp 4yrs FAC 16/01/2015
    MT2 Insp exp 1yr DB
    LB

    Basically remove repeats
    Last edited by Sam11420; 11-18-2015 at 03:38 PM. Reason: NEED HELP URGENTLY

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Post your SQL statement so that we can see exactly how you are joining the tables.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you describe in 3 or 4 lines, simple English, WHAT the database is about?
    Then post a jpg of your tables and relationships, and, as Alan asked, show us the SQL.

    My guess is that there could be a structure problem.

  4. #4
    sstiebinger is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2015
    Posts
    105
    Also, you say that each person may have "More than", but is there a minimum? Will they always have at least 1 entry in each table?

  5. #5
    Sam11420 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2015
    Posts
    9
    As requested please find below SQL Statement


    SELECT [Surname] & ", " & [Name] AS Employee, tbl_EmplQualification.Qualification, tbl_yrsofexp.[Type of Exp], tbl_yrsofexp.[Years of Exp], tbl_Employee.[Contact Number 1], tbl_Employee.Status, tbl_Employee.[Job Description], tbl_TypeofExp.[Type of Exp], tbl_TypeofExp.Exp
    FROM ((tbl_Employee LEFT JOIN tbl_EmplQualification ON tbl_Employee.link = tbl_EmplQualification.link) LEFT JOIN tbl_TypeofExp ON tbl_Employee.link = tbl_TypeofExp.link) LEFT JOIN tbl_yrsofexp ON tbl_Employee.link = tbl_yrsofexp.link
    WHERE (((tbl_Employee.Status)=[Forms]![frm_searchJobDesctoStatus]![Status]) AND ((tbl_Employee.[Job Description])=[Forms]![frm_searchJobDesctoStatus]![JobDesc]))
    ORDER BY [Surname] & ", " & [Name];


    I have exported the query, please see attached spreadsheet.

    I have also attached a spreadsheet of how I would like the query to run.

    I have also attached a screenshot of the relationships.

    please guys I am a newbie at this.
    Attached Files Attached Files

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    re: https://www.accessforums.net/queries...che-55634.html
    As Joe said (post #11), there are no duplicate records. There are, however, fields in the result set that are the same (for example the "Employee" field).



    To have the results of the query look like the example spreadsheet, you could try creating a report, grouping on "Employee" (full name). Or have VBA code to write the data to a temp table, then display using a form/report.


    About your tables.... Be aware that "Name" is a reserved word in Access and shouldn't be used for object names.
    Should only use letters, numbers and possibly the underscore in object names. Do not use SPACES, punctuation or special characters.

    IMO, "Link" is a poor name for a field.
    "tbl_miss" has repeating fields - a sure sign of design error.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-18-2015, 05:24 PM
  2. Replies: 2
    Last Post: 11-03-2014, 02:36 PM
  3. Replies: 15
    Last Post: 07-05-2013, 10:44 AM
  4. Simple Question about Multiple Table Queries
    By Access_Headaches in forum Access
    Replies: 4
    Last Post: 02-13-2012, 08:36 AM
  5. Need Help Multiple Table Queries
    By ShredYou in forum Queries
    Replies: 7
    Last Post: 09-10-2011, 01:03 PM

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