473,466 Members | 1,413 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Distinct Query with Memo Fields

2 New Member
I have looked through old posts on this and haven't found an answer, any suggestions would be great - Thanks.

Notes:
ACESS 2007
distinct_ids = 390 records
memodata.id = 714 records
RIGHT JOIN returns 714 records (with SELECT DISTINCT, memo fields are trunctated)

Expand|Select|Wrap|Line Numbers
  1. SELECT ids_memodata.*
  2. FROM ids_memodata
  3. RIGHT JOIN distinct_ids
  4. ON ids_memodata.id = distinct_ids.id;
  5.  
Apr 30 '13 #1
2 3030
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Unfortunately, Access truncates memo fields to the same length as text fields (255 characters) when grouping is involved, for practical reasons associated with how grouping is implemented. This really rules out the use of Group By or Select Distinct where memo fields are involved - with one exception for Group By queries.

Depending on the content of the memo field in relation to the other grouped fields, you may be able to use a totals (Group By) query instead of your Select Distinct one. If you substitute the memo value with a calculated field using one of the aggregate functions such as First, Last, Max or Min as a 'dummy function' on the memo field the memo field value will be returned without truncation.

The down side with the use of aggregates as 'dummy functions' to retain the memo field values is that if you do indeed require grouping on the memo contents then First, Last etc will not be suitable, as they will return specific values consistent with their purpose, not the underlying grouping you may require.

Whatever you do, don't apply SELECT DISTINCT to the results of such a query, or use it in another query with a GROUP BY clause on the calculated field - the memo field will once again be truncated back to 255 characters if you do!

-Stewart
Apr 30 '13 #2
lolab
2 New Member
Thank you for the response! Although, I don't fully understand how to use the group by and aggregate functions. I need to look into this option further. However, when testing it I created a backup copy of the database and in doing so the JOIN query (above) worked!!! Access seems to do funny things sometimes I guess. Hope this helps others in the same boat.
May 2 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Hugh Welford | last post by:
Hi ... using WIN XP/ FP 2000/ IIS. I need to be able to retieve variable length (>255 characters) messages which have been saved in a memo field in an access data base on the server. I am using...
8
by: skinnybloke | last post by:
Hi - I have a problem with a memo field being truncated to about 255 characters when running a Access 2002 query. This only seems to happen if I use SELECT DISTINCT. It works ok using SELECT by...
0
by: jimmyshaw83 | last post by:
I am sorry if this topic is tired, but after all that I have read I am still in the woods here. I have built a database to handle weekly and monthly reports of what people are doing. They submit...
13
by: ken | last post by:
I have 5 memo fields in one of my tables. I need to add 7 more. Will this be a problem? Am I being paranoid? Thanks
2
by: jacoballen | last post by:
I have a query that combines the results of three related tables. The memo fields are truncated to 255 characters, but I need all the information in them. I'm aware that removing code such as...
7
by: maffonso | last post by:
Hi guys, My table has a memo field. At the end of the month a run a report and I would like to concatenate the memo fields in a unique field by dept. Im thinking doing this through totals button...
3
by: Emily Jones | last post by:
This: TRANSFORM First(.Text) AS FirstOfText SELECT .Expr1000 FROM _allText GROUP BY .Expr1000 PIVOT .LetterSectionID; hangs the application if _allText.Text is a memo field. But it's fine...
2
by: LJB | last post by:
I have an ASP that displays two MS Access memo fields in separate table cells just fine. However when I concatenate them with SQL as in "select fld1 & fld2 as temp...." to display them in one cell...
10
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of...
6
by: GSTA | last post by:
I have tables that have one column with a bold text in a text field. This refers to a specification number. Another field is a memo field that contains the bold specification number and my...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.