Results 1 to 3 of 3
  1. #1
    snoopy2003 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    72

    Return field value based on the same table

    Hello,



    This must be simple but I do not find a way to solve it.

    I have table worker:
    workerID
    workerName
    workerManager

    workerManager is one of the workerID numbers.
    I wish to retrieve workerName based on workerManager value
    (look in the same table for a worker with workerID=workerManager)

    How can I do it ?

    Thank you for your help

  2. #2
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    From what you have said, I think what you need is a Self Join:

    SELECT workerName FROM table_worker AS A
    INNER JOIN table_worker AS B
    ON A.workerID = B.workerManager
    WHERE B.workerManager = 'value'

    If thats incorrect have a go at changing it yourself to suit your needs

  3. #3
    snoopy2003 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    72
    Hello,

    Thank you for your help.
    I am going to test it in my DB.

    Thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-01-2011, 04:03 PM
  2. Replies: 5
    Last Post: 01-20-2011, 11:36 PM
  3. Selecting a corresponding table field based on text field.
    By michaeljohnh in forum Programming
    Replies: 5
    Last Post: 10-08-2010, 10:33 AM
  4. Replies: 1
    Last Post: 05-17-2010, 12:21 PM
  5. Replies: 1
    Last Post: 02-05-2009, 04:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums