Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2017
    Posts
    1

    Angry Unanswered: single query header needing data from two tables

    Click image for larger version. 

Name:	querytables.png 
Views:	2 
Size:	105.7 KB 
ID:	17382

    Hi and thanks for reading this. My boss designed which includes the headers he needs to see. He would like to see the following headers.
    PITtag, FishID, Breeding Group, FamID, Status, Status Date, Milt sample Code, N cryopack

    now all these headers draw from different groups except breeding group. The breeding group can come from either the sire table or dam table if a fishID is matches. My problem is I can only choose sire table or dam table I cannot do both. Now is there a way to pick both tables for one header or not? Thanks !

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,476
    Provided Answers: 11
    off the top of my head

    create two new querys

    1st sire Table and adding a new coloum TableName:"Sire"
    2rd dam table and adding a new coloum TableName:"Dam"

    now Union the two new Query together.

    make shour the feildnames are the same and in the same Order VERY IMPORTANT

    now when you run the Union query u will see what table the data came from

    now you can Join the Union Query to the Main Query
    Last edited by myle; 06-15-17 at 23:43.
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

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
  •