Results 1 to 3 of 3
  1. #1
    aniletc37 is offline Novice
    Windows XP Access 2013
    Join Date
    Mar 2014
    Location
    UK
    Posts
    3

    Sql needed for this logic

    hi,



    hi,
    I have two tables like below,I need to check whether table1 data is matching with table2 data based on supplier.Here problem is
    in table1 we have two suppliers ebay and amazon and it's ids are 1 and 2 for other suppliers it should be anything.In table2
    for ebay and amazon and it's ids are 11 and 22.By using inner join i can match these data but for ebay and amazon id's are differnet
    in table2.I need to check these two tables when in table1 ebay and amazon suppliers ids are 1 and 2 and in table2 ebay and amazon suppliers ids are 11 and 22
    as per business logic and for remaining suppliers wat ever ids are present in table1 should match with table2 suppliers wat ever ids are present except ebay and amzon
    .for ebay and amzon ids are 11 and 22.any one can help me on this querry.

    table1:
    Supplier id value
    ebay 1 4
    amazon 2 5
    aa 3 6

    table2:
    Supplier id value
    ebay 11 4
    amazon 22 5
    aa 3 6

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Base on your explaination, you are trying to match on the "ID" for both table.

    Have you consider match on the "Supplier"? Are the names of supplier same for both table?

    If you are still trying to match on the "ID", you can create a query that change the ebay from 1 to 11 and amazon from 2 to 22 and use that query to match the second table (Not recommended, but it will work).

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    It is not clear from your description what the issue is. Are you having trouble with SQL or do you have a database design issue whereby the Suppliers are identified differently in different tables?
    If the latter, then you can see why having a unique identifier for Suppliers is important across an organization.

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

Similar Threads

  1. Help needed : Library catalogue in access format is needed
    By dealers in forum Sample Databases
    Replies: 3
    Last Post: 01-16-2014, 02:03 PM
  2. Need to know the logic behind the formula
    By Johin.b in forum Access
    Replies: 2
    Last Post: 07-16-2013, 03:21 AM
  3. Please help with the logic
    By Del23 in forum Access
    Replies: 1
    Last Post: 08-23-2012, 12:13 PM
  4. need better VBA logic than I currently have
    By jscriptor09 in forum Programming
    Replies: 4
    Last Post: 11-27-2011, 09:16 AM
  5. Can't get the logic right.
    By Nouri31 in forum Queries
    Replies: 3
    Last Post: 03-31-2011, 08:25 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