Results 1 to 3 of 3
  1. #1
    P3ndrag0n is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Mar 2015
    Posts
    7

    If data does not match in Column 1 Use Column 2


    Just a little bit better than a total noob in Access and very rudimentary knoledge in SQl but here goes:

    I've created a Query IN ACCESS Joining 2 tables. The join Use The Facility number and Room Number in Each Table.

    Facility numbers match perfectly in both table. No issues there.

    Room number however do not. IN the case of "Table 2" when a room number does not match in the Room coulmn, (and this cannot be changed to match) there is a second column "Room NAme" that the numbers would match the numbers in Table 1.

    My question is this, is it possible in access to create a query in which if a match is not found for the facility/room number in Table 1 to facility/room table 2 instead look for facility/roomname in table 2?

  2. #2
    RDT0086 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    6
    In the query add the table2 again (so you have two table2's in your relationships view) and then join the second table two from facility/room number to facility/roomname. You may want to use left joins.

  3. #3
    ittiekat is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2016
    Posts
    5
    Here's a possible idea. First, join only by facility. If you join by both facility and room, and they don't match, then you won't be able to pull any records (i.e. roomname).

    Then create an if statement basically like:

    IIf([Room number in table 1] = [Room number in table 2], [Room number],[Room name])

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

Similar Threads

  1. Query to find Partial Match of Column Data
    By rachmorr9 in forum Queries
    Replies: 2
    Last Post: 09-22-2015, 09:09 PM
  2. Replies: 4
    Last Post: 02-06-2014, 03:35 PM
  3. Replies: 1
    Last Post: 11-12-2013, 02:19 AM
  4. Replies: 1
    Last Post: 12-08-2011, 08:03 AM
  5. Replies: 1
    Last Post: 08-18-2011, 08:35 AM

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