+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    2

    Simple Access Help.. null values

     
    Sorry if I'm repeating other questions, I searched your boards and didn't come up with anything.

    I have (what I think) is a pretty simple question...

    In Access.. I'm trying to query from two tables at once.

    Example: TableNames and TableCity

    Not all records listed in TableNames are accounted for in TableCity.

    Say Names has 100 records, and City only has 50. Is there a way to query both, and have the City show up as null/blank if there is no association with the Names table?

    Please let me know if you have the time. Thanks!!

  2. #2
    Ultimate Member zepper's Avatar
    Join Date
    Sep 2002
    Location
    Finger Lakes area
    Posts
    2,398

    Lightbulb

    Welcome to the TechIMO forums.

    Are the TNames and TCity tables part of the same database or different databases? If part of the same database, then this may be a case of "over normalization". When storage space was at a premium, very fine normalization might have been justified. That is no longer the case.
    . How do the records in TNames relate to the records in TCity, or is there no detectable relationship? If there is some sort of relationship, create a linking table based on the relationship.
    . Perhaps the data entry forms or scripts were not designed correctly. If there is a relationship, the data entry method should have included that - with the City table as a lookup or something when entering the info into the Names table.

    .bh.

    Last edited by zepper; September 1st, 2005 at 01:52 PM.
    "Our freedom depends on five boxes: soap, ballot, jury, witness; and, when all else fails, Ammo. " ?author?

  3. #3
    Junior Member
    Join Date
    Sep 2005
    Posts
    2
    Same database.

    Here's the short story..

    I have a large database with a bunch of people in it.. and each individual is assigned a NameID.

    There are a bunch of other tables too.. using TCity as an example.. in there is a list of Citys, and each is assigned a CityID.

    The main table has a field for CityID, which is related to the TCity table.

    I can query the main table for the "CityID", but that just spits out a bunch of unusable numbers. The actual names of the cities which relate to the ID are in the TCity table, and when I use that to query the names it limits the outcome to only the individuals in the TCity table.

    Example:
    (in the names table)
    Name CityID
    John 4353456
    Dave 232452
    Sue (null)


    If I query using both the tables (So I can see "New York" as opposed to 4353456).. all I get are the first two names because there is no value associated with Sue.

    I hope I made sense. Thanks for the quick reply!!!

  4. #4
    Ultimate Member zepper's Avatar
    Join Date
    Sep 2002
    Location
    Finger Lakes area
    Posts
    2,398
    If value="" (null) then use "Not Available".
    You get the idea, but you'll have to find out the way Access does it. There are forums out there specifically for Access and I think a specific section on the Tek-Tips site.

    .bh.
    "Our freedom depends on five boxes: soap, ballot, jury, witness; and, when all else fails, Ammo. " ?author?

  5. #5
    Member Acid_ICE24's Avatar
    Join Date
    Jul 2005
    Location
    Cavite, Phil.
    Posts
    94
    Quote Originally Posted by Roccapriore
    Example:
    (in the names table)
    Name CityID
    John 4353456
    Dave 232452
    Sue (null)


    If I query using both the tables (So I can see "New York" as opposed to 4353456).. all I get are the first two names because there is no value associated with Sue.
    try this query:
    "SELECT a.Name, b.CityID
    FROM TableNames a
    LEFT JOIN TableCities b
    ON a.CityID = b.CityID"

    hope this helps.
    keep 'em comin...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Access VBA - Don't want form to close if null
    By MushMouse in forum Technical Support
    Replies: 4
    Last Post: August 11th, 2009, 09:43 AM
  2. VB Help with Void Null
    By redfoxstorm in forum Webmastering and Programming
    Replies: 37
    Last Post: April 16th, 2005, 12:31 AM
  3. MS Access: Passing values from a form to a parameter query
    By NoLimit in forum Webmastering and Programming
    Replies: 5
    Last Post: December 15th, 2003, 06:12 PM
  4. Replies: 0
    Last Post: March 3rd, 2003, 03:56 PM
  5. redhat null: anyone know about it?
    By storm2k in forum Applications and Operating Systems
    Replies: 3
    Last Post: August 24th, 2002, 12:55 PM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews