+ Reply to Thread
Results 1 to 8 of 8

Thread: Basic 1:1 query

  1. #1
    Registered User
    Join Date
    09-02-2009
    Location
    Texas, USA
    MS-Off Ver
    Excel 2007
    Posts
    59

    Basic 1:1 query

    Here is the situation, I have two databases that track the amount of lots in a neighborhood. This is in access 2003.

    (please see attached files)
    "RealLots.xml" This has the correct number of entries at 495 total. In addition, it has the "LOT ID" column which is critical for this join.

    "HOA_Entity.xml" This has the incorrect number of entries at 588, so a change in total entries from 588-495= 93, so this database has 93 more entries than I need. BUT it has the "partnership" column which is also critical for the join.

    When I query the data, as shown in the image right herehttp://img.photobucket.com/albums/v1...rww/help-6.jpg. Note: the query is doing a 1:1 relationship based on address which is found in both databases. What am I doing wrong?

    Many Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,791

    Re: Basic 1:1 query

    Hi cmf0106,

    Your query is showing you that there are only 470 records "in common" between the two tables when "Address" is used as the join. As you pointed out, "HOA_Entity.xml" has more records (588), but it would seem to have 118 entries that are not in "RealLots2003"; as well, "RealLots2003" has 25 entries that are not in "HOA_Entity.xml".

    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    09-02-2009
    Location
    Texas, USA
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Basic 1:1 query

    Is there a way I could make it such that it displays all 495 records, but have a null value for the 25 with no "common" attribute.

    e.g. 470 had a match a "common match", 25 of that 495 did not therefore did not display. I would like it to go ahead and display the 470 common matches + the 25 that did not have the common match to get the 495 total.

    Thanks

  4. #4
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,791

    Re: Basic 1:1 query

    Hi cmf0106,

    Yes. While in query design mode, right click on the join (the little black line) and select "Join Properties". Select option 2 or 3, whichever one that says, "Include ALL records from 'RealLots2003' and only those records from 'HOA_Entity' where the joined fields are equal." Click Okay, and run the query.

    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    09-02-2009
    Location
    Texas, USA
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Basic 1:1 query

    Thats good thanks, but is there a way in addition to what you stated to fill the blank cells with <Null> if it doesnt have something in "common"?

  6. #6
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,791

    Re: Basic 1:1 query

    Hi cmf0106,

    Put this in place of "Partnership" in your query:

    Code:
    Partner: IIf([Partnership] Is Null,"<null>",[Partnership])
    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  7. #7
    Registered User
    Join Date
    09-02-2009
    Location
    Texas, USA
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Basic 1:1 query

    Quote Originally Posted by ConneXionLost View Post
    Hi cmf0106,

    Put this in place of "Partnership" in your query:

    Code:
    Partner: IIf([Partnership] Is Null,"<null>",[Partnership])
    Cheers,
    Many thanks, but is there a method to automatically "null" everything in the worksheet in this manner? e.g. not having to specify a particular row or column but rather is null applies to the whole work sheet?

    Many thanks

  8. #8
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,791

    Re: Basic 1:1 query

    Hi cmf0106,

    I'm not sure I understand your question, but if you want to remove all the data from the table, then you can just use a delete query such as:

    Code:
    DELETE HOA_Entity.*
    FROM HOA_Entity;
    Cheers,

    BTW ~ You don't need to quote my entire post in your reply, just use the reply button in the lower left.
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0