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

    Unanswered: help on select distinct query

    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
    Oct 2001
    Location
    Chicago
    Posts
    440
    Try this:


    SELECT DISTINCT * FROM (SELECT [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]);
    Last edited by Rockey; 10-15-02 at 08:58.

Posting Permissions

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