Results 1 to 5 of 5
  1. #1
    drhassan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    10

    Please help: what is wrong with this query?

    I am trying to build a database by MS access 2010 for Animal Import Control Ports. I have three tables names are: Importers, Consignments, Staff, and one table named tbgroup (ID, importer ID, consignment ID, and Staff ID).

    The problem is when I relate the primary key (the IDs) of each table with the tbgroup table, and run it in a query it dosen't retrieve any data from those tables.

    What is wrong with this query.

    Please any idea on how to build a good relationship for this database?



    Database is attached for more digestion.

    Thanks
    Attached Files Attached Files

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Your biggest problem is that the query uses inner joins from tbgroup to the other tables. There are 0 records in your tbgroup so 0 records are found. Try putting some sample data in that table or read up on Outer Joins.

  3. #3
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536

  4. #4
    drhassan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    10
    I'm newly registered member if you noticed and I have no idea that the cross posting is unacceptable. My intention was only to find someone who can help me in this problem. Anyway I apologize for this inadvertent mistake and ignorance.

    Thank you

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Here is what I understand about your data: it is documenting the shipment of animals - species, importer, and staff assigned.

    Assuming importers and staff can have multiple consignments and each consignment will always have associated importer and one staff, consider tables:

    Importers
    ImpID (primary key)
    ImpLastName
    ImpFirstName
    other fields for contact info

    Staff
    StaffID (primary key)
    FirstName
    LastName
    other fields as needed

    Consignments
    ID (primary key)
    ArrDate
    Type
    Gender
    Qty
    ImpID (foreign key)
    StaffID (foreign key)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Access giving wrong result using sql query
    By amlanroy in forum Access
    Replies: 3
    Last Post: 05-10-2012, 10:11 AM
  2. What's wrong with this expression in a query?
    By djclntn in forum Queries
    Replies: 18
    Last Post: 11-17-2011, 06:12 PM
  3. What's wrong with my query?
    By Grek in forum Queries
    Replies: 2
    Last Post: 10-31-2011, 12:12 PM
  4. What's wrong with this query?
    By jsoldi in forum Queries
    Replies: 2
    Last Post: 10-11-2010, 07:45 AM
  5. Query for latest date? what am I doing wrong?
    By Overdive in forum Queries
    Replies: 1
    Last Post: 12-18-2009, 06:04 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