Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 11-17-2009, 09:22 AM
cmf0106 cmf0106 is offline
Registered User
 
Join Date: 02 Sep 2009
Location: Texas, USA
MS Office Version:Excel 2007
Posts: 54
cmf0106 is becoming part of the community
Basic 1:1 query

Please Register to Remove these Ads

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
File Type: xlsx RealLots.xlsx (156.2 KB, 3 views)
File Type: xlsx HOA_Entitiy.xlsx (30.2 KB, 0 views)
Reply With Quote
  #2  
Old 11-17-2009, 12:16 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 576
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
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.
Reply With Quote
  #3  
Old 11-17-2009, 01:34 PM
cmf0106 cmf0106 is offline
Registered User
 
Join Date: 02 Sep 2009
Location: Texas, USA
MS Office Version:Excel 2007
Posts: 54
cmf0106 is becoming part of the community
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
Reply With Quote
  #4  
Old 11-17-2009, 03:12 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 576
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
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.
Reply With Quote
  #5  
Old 11-17-2009, 03:37 PM
cmf0106 cmf0106 is offline
Registered User
 
Join Date: 02 Sep 2009
Location: Texas, USA
MS Office Version:Excel 2007
Posts: 54
cmf0106 is becoming part of the community
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"?
Reply With Quote
  #6  
Old 11-17-2009, 03:52 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 576
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
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.
Reply With Quote
  #7  
Old 11-19-2009, 10:54 AM
cmf0106 cmf0106 is offline
Registered User
 
Join Date: 02 Sep 2009
Location: Texas, USA
MS Office Version:Excel 2007
Posts: 54
cmf0106 is becoming part of the community
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
Reply With Quote
  #8  
Old 11-19-2009, 11:11 AM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 576
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
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.
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump