Results 1 to 5 of 5

Thread: group bt

  1. #1
    Join Date
    Oct 2002
    Posts
    933

    group bt

    how can I do a GROUP BY involving a memo field?

    Select Employeeid, Notes FROM Employees GROUP BY EMployeeid, Notes

    In Access the above returns a 255 char Notes field which is a truncate of the full memo field.

    In MS-SQL this query is not even valid.

    How can I get a GROUP BY of employeeid, Notes just like Select Employeeid, Notes from Employees?

    Thanks,

    Frank

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Don't think you can do that with t-sql.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    if you like to trade text for varchar(8000) then you can do it

    create table emp (id int, notes text, date datetime)

    insert into emp select 1,'xxxxxxxx',getdate()
    insert into emp select 1,'sdsxxxxxxxx',getdate()
    insert into emp select 2,'xxxfffxxxxx',getdate()
    insert into emp select 2,'xxxxggxxxx',getdate()
    insert into emp select 1,'xxxxxhhxxx',getdate()
    insert into emp select 3,'xxxxxjjxxx',getdate()
    insert into emp select 3,'xxxxkkkxxxx',getdate()
    insert into emp select 3,'xxxxkkkxxxx',getdate()


    select id,convert(varchar(8000),notes) as Notes,date from emp group by id,convert(varchar(8000),notes) ,date

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    MAK,

    looks like a winner here with MS-SQL. Access is out of luck (255 for them) and I'll cruise over to My-SQL to see how they do it!!!

    Thanks,


    Frank

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    What will happen if you have more than 8000 characters in text column? Still get correct grouping?

Posting Permissions

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