Results 1 to 3 of 3

Thread: Query

  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Unanswered: Query

    I'm trying to create a query from 2 tables that will match the names from one table to the address of another. The one table has first initial and last name but the other table has first name and last name. I want the query to select the first name from the one table that begins with first first-name initial from the other table. The query I created was the following: SELECT([First Name]FROM[No blanks FAA Airman List](WHERE([First Name]FROM[No blanks FAA Airman List]BEGINS WITH [First Initial]FROM [USAir Pilots])). I keep getting a syntax error message. What's wrong with the query?
    Ginger

  2. #2
    Join Date
    May 2004
    Posts
    65

    create a new key in the query

    create a new field in the query eg. newkey

    newkey: left(Firstname,1) & Surname

    that will give you the link field to your original table.

    (You may want to check the syntax of left()

    By the way... what happens if you have two John Smiths in your airman table?
    Perhaps you need to add the birthdate as well.

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi Ginger,

    Are these two tables already linked by some common field?? How are the names going to logically match each other? Also as stated, what if you have 2 John Smiths?? What distinguishes the two apart from another? However, if you already have these two related to each other then a simple ComboBox would allow you to automatically pull over the results.

    Just some thinking
    Bud

Posting Permissions

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