Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: Access Function Help

    Hi All:
    I have two tables table A & table B. Table A has field A & Table B has field B.I want to get all the matching data from table A's field A that matches any of the first 11 characters of table B's field B.

    Is there a function in Access that I can use it in querying??

    Immediate response is quite appreciated.


    Thanks in advance!!!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Access Function Help

    Originally posted by mannkasyap
    Hi All:
    I have two tables table A & table B. Table A has field A & Table B has field B.I want to get all the matching data from table A's field A that matches any of the first 11 characters of table B's field B.

    Is there a function in Access that I can use it in querying??

    Immediate response is quite appreciated.


    Thanks in advance!!!
    SELECT TableA.A FROM TableA, TableB WHERE (TableA.A=Left(TableB.B,11));

  3. #3
    Join Date
    Mar 2004
    Posts
    4

    Re: Access Function Help

    Originally posted by M Owen
    SELECT TableA.A FROM TableA, TableB WHERE (TableA.A=Left(TableB.B,11));
    Thanks for the fast reply, but I want more specific query. Sorry If I wasn't clear enough in my first post.

    I want all the records from Field A in table A that matches/exists in the field B in table B.


    Thanks Once again!!!

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Access Function Help

    Originally posted by mannkasyap
    Thanks for the fast reply, but I want more specific query. Sorry If I wasn't clear enough in my first post.

    I want all the records from Field A in table A that matches/exists in the field B in table B.


    Thanks Once again!!!
    Can you give an example of what you're looking to do? Your expalnation is rather vague (and subject to misinterpretation) ...

  5. #5
    Join Date
    Mar 2004
    Posts
    4

    Re: Access Function Help

    Originally posted by M Owen
    Can you give an example of what you're looking to do? Your expalnation is rather vague (and subject to misinterpretation) ...
    For example:

    I have some lengthy data in Record 1 in Field B. Record 1 in Field A has data that may or may not be PART of the FIRST 15 characters of record 1 in field B. If its a PART of Record 1 in Field B, then I want all such records in Field A of Table A that matches to the records in Field B.

    Hope I'm clear.

    Thanks!!

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Access Function Help

    Originally posted by mannkasyap
    For example:

    I have some lengthy data in Record 1 in Field B. Record 1 in Field A has data that may or may not be PART of the FIRST 15 characters of record 1 in field B. If its a PART of Record 1 in Field B, then I want all such records in Field A of Table A that matches to the records in Field B.

    Hope I'm clear.

    Thanks!!
    Well look at my 1st post then ... Yuo changed things up tho: going from the 1st 11 char to now 15 ... Just change the # of char to match against. Now, again, there is some wiggle room here on your explanation ... Which table is the controlling table? A or B? Also are you looking for all matching records to a SINGLE record in the other table?

  7. #7
    Join Date
    Mar 2004
    Posts
    4

    Re: Access Function Help

    Originally posted by M Owen
    Well look at my 1st post then ... Yuo changed things up tho: going from the 1st 11 char to now 15 ... Just change the # of char to match against. Now, again, there is some wiggle room here on your explanation ... Which table is the controlling table? A or B? Also are you looking for all matching records to a SINGLE record in the other table?
    Thanks for the reply Owen.

    Table A is the controlling. it has 5000 records & table B has 1200. Yeah I changed it back to 10, but thats not a issue.

    I tried using your first post, but I don't see any results when I ran it.

    I want all records matching to field B.


    Thanks once again!!

  8. #8
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Access Function Help

    Originally posted by mannkasyap
    Thanks for the reply Owen.

    Table A is the controlling. it has 5000 records & table B has 1200. Yeah I changed it back to 10, but thats not a issue.

    I tried using your first post, but I don't see any results when I ran it.

    I want all records matching to field B.


    Thanks once again!!
    Revese it then .... I just did a test with : SELECT [Table A].*
    FROM [Table A], [Table B]
    WHERE (left( [Table A].A,3)=[Table B].B);

    With data like:

    Table A Table B
    Dog Dog
    doggy Cat
    doggie
    doggone
    dogby

    And this query returned everything in A matching "Dog" in B

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •