Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    3

    Unanswered: select distinct query on a memo field in access

    Hi,

    I need to use select Distinct(*), but one of my fields "Description" is of datatype memo. But I need to use a distinct on this field. Access does not allow the usage of distinct with a memo field.


    There was a post in the forum suggesting the use of Mid() function to spilt the memo field. I tried that and it didnt work either. The query that I used was:

    SELECT DISTINCT [program_id], [station_no], [title], mid(Description,1,255) AS part1, mid(Description,255,255) AS part2, [duration], [segment_date], [status_complete], [host], [guest], [info_URL], [parser_URL], [ArchiveFlag], [Source], [Source_date], [parser_errors], [description]
    FROM segment_event_raw
    WHERE station_no=0 And ArchiveFlag='N' And status_Complete<>0
    ORDER BY [program_id], [segment_date];

    This returned me an error saying that "Distinct cannot be used with memo "


    Could you pls tell me how I can get around with this problem. Any suggestions is greatly appreciated.

    Thanks!
    Priyanka

  2. #2
    Join Date
    Feb 2007
    Posts
    1
    Hi Priyanka,

    Try SELECT DISTINCT TRIM(DESCRIPTION) FROM TABLE_NAME;

    Thanks,
    Mehul

  3. #3
    Join Date
    May 2009
    Posts
    1

    Thanks,

    That worked like a charm. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •