
SELECT works, but SELECT DISTINCT fails
As follow-up - it turns out it *was* the number of records that was making
DISTINCT fail. I have already worked around it by using
.Open "SELECT Lab FROM LAP ORDER BY Lab"
then flipping through the sorted records and deleting any duplicates. I'll
be interested to try that GROUP BY, though.
Thanks for your reply.
Peter Bradshaw
Quote:
> You can also try
> .Open "SELECT Lab FROM LAP GROUP BY Lab"
> It may be more forgiving.
> > You have opened a new door for me to investigate. I have been hammering
on
> > the theory that it is the *number* of records that is making it fail,
> since
> > it worked with a small set of records. But I'll bet there is a single
bad
> > *record* in that bigger table that is making it fail - I just haven't
seen
> > it because there are so many. Probably too long.
> > To answer your question... Lab is a Memo field in an Access table named
> LAP.
> > Maybe using DISTINCT requires strings under 256 characters.
> > Thanks for your reply.
> > Peter Bradshaw
> > > What's the datatype of Lap.Lab? Have you compared the execution
plans?
> > > --
> > > Patrick Logan, MCSD
> > > Opinions expressed are my own and not necessarily those of my
employer.