[AccessD] Select Distinct not working on union query- due to MEMO field?

jwcolby jwcolby at colbyconsulting.com
Tue Jul 12 08:43:08 CDT 2011


It never occurred to me to use left(MemoField,255) when I needed to do something like that.

The obvious is sometimes easy to miss.

John W. Colby
www.ColbyConsulting.com

On 7/12/2011 8:51 AM, William Benson (VBACreations.Com) wrote:
> Oh that is good to know! Yes, that will cut out a step or two now and in
> future.
>
> I appreciate the follow up on this!
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
> Sent: Tuesday, July 12, 2011 8:02 AM
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] Select Distinct not working on union query- due to
> MEMO field?
>
> Hi Bill
>
> But you are missing the obvious - the DISTINCT is not needed if you use
> UNION and not UNION ALL.
>
> If you don't need memo fields, certainly don't use them. If you have the
> need (for holding text beyond 256 chars) you may in your UNION or DISTINCT
> query use:
>
>    LEFT(YourMemoField, 256)
>
> /gustav
>
>



More information about the AccessD mailing list