Results 1 to 4 of 4
  1. #1
    Jay82 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2023
    Posts
    3

    Need Help - Joining Tables with a Range and Wildcards values

    Morning gurus




    I'm stumped and need some help with a query join.


    I have a table called "Role_Transactions" (its from SAP) and for each "Role", it has multiple "TCode_From" and "TCode_To" values. Example below;
    Click image for larger version. 

Name:	Roles.jpg 
Views:	12 
Size:	251.2 KB 
ID:	49683

    I need to match all the "TCodes" from table "Transactions" to the "TCode_From" and "TCode_To" values above, and display both "Role" and "TCode" in the output.
    Click image for larger version. 

Name:	Transactions.jpg 
Views:	12 
Size:	77.3 KB 
ID:	49684

    Here's where it gets tricky for me;

    - If only "TCode_From" is populated ("TCode_To" is null), then the match is exact between the two tables.

    - If there is a value in "TCode_To", that indicates all "TCodes" within the range should be matched.

    - Sometimes "TCode_From" and "TCode_To" have a * for a wildcard in them too. Indicating that only the "TCodes" between the two ranges should be matched.



    I need "Role" and "TCode" to be output.



    Any help would be greatly appreciated!



    Cheers!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Please provide data as a table in post (can copy/paste Access or Excel) or attach file.

    Table builder/editor in Advanced post editor.

    Cross-post https://www.access-programmers.co.uk...values.326657/ and https://www.utteraccess.com/topics/2064468?post=unread
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jay82 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2023
    Posts
    3
    Hi @June7

    See attached "Example Data Set.zip". Thanks for your help!
    Attached Files Attached Files

  4. #4
    Jay82 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2023
    Posts
    3
    Solved, solution at the following URL.

    https://www.access-programmers.co.uk/forums/threads/need-help-joining-tables-with-a-range-and-wildcards-values.326657/



    My apologies cross-posting and not calling it out too. I'll me mindful of that going forward.

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

Similar Threads

  1. Query Multiple Tables for Match with wildcards
    By dccjr3927 in forum Programming
    Replies: 5
    Last Post: 10-29-2019, 12:13 PM
  2. joining 2 tables
    By anasttin in forum Access
    Replies: 12
    Last Post: 07-23-2017, 05:21 PM
  3. Joining two tables
    By rspai in forum Queries
    Replies: 7
    Last Post: 05-22-2012, 12:21 AM
  4. joining tables
    By frozendmj in forum Queries
    Replies: 5
    Last Post: 04-19-2011, 01:45 PM
  5. Help - Joining Tables..
    By fabian24 in forum Forms
    Replies: 3
    Last Post: 02-17-2011, 03:43 PM

Tags for this Thread

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