Truncation of memo fields in SELECT queries - Access 2002

D

datawizzard

After an extensive search of the MS knowledge base, I still can't find an
answer:

I have a simple SELECT query joining two tables, and I use the query as the
data source for a form. One of the tables contains memo fields that I want
to display on the form. I have the "Unique Values" property set to "Yes" to
avoid getting duplicate results. When I run the query, the memo fields are
truncated at 255 characters. This only happens when the "Unique Values"
property is set to "Yes". I know that Access will only use the first 255
characters of a Memo field to do comparisons for a Parameter query, and the
"Unique Values = Yes" setting does cause internal comparisons to take place
when Access runs my SELECT query, even though it's not a Paramater query.
However, I've found nothing that says memo fields will be truncated in the
result set in any scenario! Is there a way around this? Or is it an
"undocumented feature" of MS Jet . . .

(Using MS Jet version 4.0.6218.0)
 
J

John Vinson

I have the "Unique Values" property set to "Yes" to
avoid getting duplicate results. When I run the query, the memo fields are
truncated at 255 characters.

Yep. This is well known behavior.

It's not really a "bug" though you're quite right that it should be
better documented. After all, a Memo field could contain a gigabyte of
data - having Access compelled to check the gigabyte of data in this
record with the gigabyte of data in the next record to discover that
they are different in the 942,845,298th byte is perhaps a bit
unreasonable! <g>

What you can do to exclude duplicates on the *remaining* fields is to
use a Totals query; Group By the fields other than the memo (and, if
you wish, on a calculated field Left([memofield], 255); and use the
First operator on the memo field to find the first instance of the
memo field in the group. If your data contains records where the ONLY
difference between the records is past the 255th byte in the memo
field you'll miss that fact (and see only the first of the
near-duplicates). If your data has such records I don't know of a good
way to de-duplicate them though!

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top