Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do group by on a text file

Status
Not open for further replies.

katekis

MIS
Feb 12, 2009
66
US
How do group on a text file?

select
ivr_msg, count(ivr_end_date)
from dbo.Wings_IVR_CallInformation
group by ivr_msg

Error Message:
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

Can I convert ivr_msg to a different type and then group? How can I do that, I can not change the table structure, just need to make a query to count the different iver_msg.

Thanks,
 
Code:
select
   SubString(ivr_msg, 1, 4000), count(ivr_end_date)
from dbo.Wings_IVR_CallInformation
group by SubString(ivr_msg, 1, 4000)

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
use tableschema;
go
select ivr_msg from dbo.Wings_IVR_CallInformation;
go
select count(ivr_msg) from dbo.Wings_IVR_CallInformation;
go
That might work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top