match data in two columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Noelene
    New Member
    • Jan 2007
    • 3

    #1

    match data in two columns

    This must me easy. I want my query to return results when the data in two text fields match. i.e. when the Manager and Supervisor are the same person. Can you help?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    Too little information for a reliable reply here Noelene (Please refer to POSTING GUIDELINES: Please read carefully before posting to a forum).
    However, if you are talking about selecting records from a simple dataset (Table or QueryDef) where two of the fields in that dataset have the same data, then you could do something like :
    Code:
    SELECT *
    FROM [YourTable]
    WHERE [Manager]=[Supervisor]

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Originally posted by Noelene
      This must me easy. I want my query to return results when the data in two text fields match. i.e. when the Manager and Supervisor are the same person. Can you help?
      You can also accomplish this from the Query Design Grid. Assuming that the Manager and Supervisor Fields are in a Table called tblCompany:
      1) Create a New Query.
      2) Add tblCompany.
      3) Add tblCompany again, it will display as tblCompany_1.
      4) Create a Join between the Manager Field in tblCompany and the Supervisor Field in tblCompany_1 (called a Self Join).
      5) Drop any Fields into the Query Grid.
      6) Run the Query, only Records in which the Manager and Supervisor Fields have the same value will be displayed.

      Comment

      Working...