Results 1 to 3 of 3
  1. #1
    Nixx1401 is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Feb 2010
    Location
    Barbados
    Posts
    115

    Query

    I have this query with the following sql. I have an invitee table, contact table and an inmate table the relationship is 1 inmate and 1 contact to many invitee, 1 inmate to many contacts. I would like to display the inmate name, contact name, address, invitee name as you would view in the sql but it is generating duplicate entries once there is an inmate with more than one entry



    SELECT [tblContactInfo Query].DteDate, [tblContactInfo Query].StrInmateNo, [tblInmateInfo Query].[Inmate Name], [tblContactInfo Query].[Contact Name], [tblContactInfo Query].StrAddressLine1, [tblContactInfo Query].StrAddressLine2, [tblContactInfo Query].StrParish, [tblContactInfo Query].[Invitee Name], [tblContactInfo Query].StrChild
    FROM (tblInmateInfo INNER JOIN [tblInmateInfo Query] ON tblInmateInfo.StrInmateNo = [tblInmateInfo Query].StrInmateNo) INNER JOIN [tblContactInfo Query] ON tblInmateInfo.StrInmateNo = [tblContactInfo Query].StrInmateNo;

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Try using GROUP BY (Sigma button) in the query.

    Why did you include tblInmateInfo in the query?

    Cheers,

  3. #3
    Nixx1401 is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Feb 2010
    Location
    Barbados
    Posts
    115

    Query

    I used the group by and it worked then when i then started a blank database and import the structure only to remove the test data the query refuse to run even if i try to recreate it.

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

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