+ Reply to Thread
Results 1 to 3 of 3

Thread: Best way to lookup a value?

  1. #1
    Valued Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2007
    Posts
    345

    Best way to lookup a value?

    Good day - I'm quite obviously very inexperienced with Access (I do most of my work in excel, but need to get my hands into Access for larger data sets).

    I'm not quite sure how to proceed with this seemingly simple task. Any help/guidance would be appreciated!

    I have two tables, DATA, and VALUES
    In my DATA table, I have a column with an index ticker, a description, etc.
    In my VALUES table, I have a column with *some* of the same index tickers and an associated product code.

    What I'd like to do is:
    For each index ticker in DATA, find in VALUES. Once found, return the associated product code (or somehow display the union between the index ticker from DATA and the associated product code from VALUES).

    Would this be done in a query? I can't seem to get the right syntax. I assume once I get the query to work I can just set up a report, which shouldn't be a problem... but first things first - do I use the query design, or do I have to try to figure out the sql directly?

    Thanks for any guidance
    JP
    Last edited by JP Romano; 01-25-2011 at 09:16 AM. Reason: Solved

  2. #2
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,161

    Re: Best way to lookup a value?

    You will need to set up a query. Using the QBE (query design). Bring both tables into the query. Join the tables on the common field. If you want only those instances where they appear in both tables, do nothing to your join. If you want all instances of your Data table to appear and only those instances in your Values table, then make your join an outer join (probably a LEFT). Drag the fields you want to the grid and run your query. If you have any specific criteria, put in the criteria line for the particular field. Post back if you have further questions or needs.

    Here is a good site to look at for setting up queries.

    http://www.techonthenet.com/access/queries/index.php

    There are many others, but this should help to get you started.

    Once you have your query working, use it as your record source for your report or export the results to Excel for further analysis or work.

    Alan
    Last edited by alansidman; 01-24-2011 at 07:28 PM.

  3. #3
    Valued Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2007
    Posts
    345

    Re: Best way to lookup a value?

    Thanks... looks like the JOIN was what I was missing... much appreciated!

+ Reply to Thread

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