Results 1 to 7 of 7
  1. #1
    cherold is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    82

    query truncates long text field!

    I have a query that gets all values from a table conditional on a value in another table. The query returns a truncated "long text" field; it only shows the first 255 characters. If I just open the table directly it displays the full text.



    This is my query:
    Code:
    SELECT DISTINCT Compositions.* 
    FROM Discs INNER JOIN (Compositions INNER JOIN DiscContents ON Compositions.CompositionID = DiscContents.composition_id) ON Discs.DiscID = DiscContents.disc_id
    WHERE (((Discs.Status)<12));
    The field that's giving me trouble is Compositions.Composition. It is defined as "long text." I found one thread on a similar issue (which turned out to be an issue with an import from Excel, which is not my case) in which one suggestion was to change the text format to "rich text." (Although apparently for that to work you'd need to set it to rich text before importing from Excel so that's irrelevant.) So I'll mention that changing the field to rich text did not fix the issue.

    Why isn't it giving me the full field contents? How do I fix it?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    It’s because you are grouping remove the distinct and you should see the full text

  3. #3
    cherold is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    82
    I added the DISTINCT because without it the query gives me doubles of Composition rows that are referenced more than once in DiscContents. So I can't remove it unless there's an alternate way to prevent those doubles.

    Why does DISTINCT affect the length of returned text fields? Why would grouping interfere with how fields are displayed?

    Quote Originally Posted by Ajax View Post
    It’s because you are grouping remove the distinct and you should see the full text

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    There is a limit to how many chars can be grouped for any one field - 255. Implication is your tables are not constructed correctly or you query needs to be constructed differently. Only on my phone so can’t really advise

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Operations that involve long text fields (aka memo) often truncate data; that's a known "thing". You might solve this by first preventing dupes in query1 (but do not include long text field) then include memo field in 2nd query and join on the field that you forced to be unique.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Allen Browne has an excellent summary of the reasons why memo/long text fields can get truncated in Access http://allenbrowne.com/ser-63.html
    Basically any processing will cause truncation.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    esoenke is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    1
    Thanks-- this just saved me endless trouble. Much appreciated!

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

Similar Threads

  1. Replies: 8
    Last Post: 01-07-2020, 12:28 PM
  2. Replies: 4
    Last Post: 11-04-2019, 06:53 PM
  3. Replies: 24
    Last Post: 03-12-2019, 08:02 PM
  4. ImportExportSpreadsheet truncates Long Text to 255, please help
    By Sephaerius in forum Import/Export Data
    Replies: 13
    Last Post: 04-14-2016, 06:14 AM
  5. Long Text field in an Update query
    By Dave D in forum Queries
    Replies: 2
    Last Post: 08-03-2014, 12:10 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