-
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
-
Don't think you can do that with t-sql.
-
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
-
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
-
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
-
Forum Rules
|
|