Results 1 to 7 of 7
  1. #1
    ram_son is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2011
    Posts
    4

    query that merges records

    I am working with a data base that has two tables for words and synonyms. I have managed a query that goes like this:

    SELECT word, synonym
    FROM pat_words, pat_synonyms
    WHERE (pat_words.word_id=pat_synonyms.word_id);

    An sample of the result I get is:

    word synonym

    abandonment desertion
    abandonment leaving
    abase belittle
    abase degrade

    The result I'd like to see is :

    word synonym

    abandonment desertion/ leaving
    abase belittle/ degrade



    I imagine that, for an expert, it is something quite basic and simple; but for someone like me (very new to Access) it constitutes an effective of headache.

    I would appreciate any help.

    Ram_son

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe you will find this link helpful: http://allenbrowne.com/func-concat.html

  3. #3
    ram_son is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2011
    Posts
    4
    I got the module to compile Ok but when I refer to it in the SELECT statement I get "undefined function" error.

  4. #4
    ram_son is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2011
    Posts
    4
    I followed the instruction in the article from the link got the module to compile ok but when I refer to it in the SELECT statement I get "undefined function" error. Why am I getting this error.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It sounds like you named the module the same as the Function; don't! Name it basFunctions or something.

  6. #6
    ram_son is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2011
    Posts
    4
    When I run the the statement now I get an error about ambiguous name in the ConcatRelated part of the statement. I tried changing the id names to no avail. This is the last one I tried. May be you can see what's wrong with it.

    SELECT word, ConcatRelated("synonym", "pat_Synonyms", "[pat_words.word_id] = " & [pat_synonyms.word_id])
    FROM pat_words;

    Thanks

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why are you scoping those fields? I would think it should be:
    SELECT word, ConcatRelated("synonym", "pat_Synonyms", "[word_id] = " & [word_id])
    FROM pat_words;

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

Similar Threads

  1. Can't get all records in query
    By salisbut in forum Queries
    Replies: 2
    Last Post: 08-12-2010, 10:00 AM
  2. Replies: 1
    Last Post: 06-30-2010, 12:47 PM
  3. Return all records from Query
    By ysrini in forum Queries
    Replies: 1
    Last Post: 01-15-2010, 09:52 PM
  4. Query two different records in the same table
    By Eildydar in forum Access
    Replies: 5
    Last Post: 04-15-2009, 01:39 PM
  5. query that will contain all unique records
    By halcolm1 in forum Queries
    Replies: 0
    Last Post: 01-19-2007, 05:34 PM

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