Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Select query errortext ntext cannot compared to..

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2007-01-29 : 16:13:13
I am getting the folloiwng error when tried to run the query:

Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
select RM.SequenceNo, RM.RMTitle, RM.OrigSender, 
CONVERT(varchar(10), RM.DocumentDate, 101) AS DocumentDate,
CONVERT(varchar(10), RM.ReceivedDate, 101) AS ReceivedDate,
CONVERT(varchar(10), RM.AcknowledgedDate, 101) AS AcknowledgedDate,
RM.AdditionalInfo, PG.ProgName, PJ.ProjName, CT.ContractName
FROM TAB_ccsNetRM AS RM JOIN TAB_ccsNetUserAccess AS U ON (RM.ProgID = U.ProgID AND RM.ProjID = U.ProjID AND RM.ContractID = U.ContractID AND U.USERID=1)
INNER JOIN TAB_ccsNetPrograms PG ON RM.ProgID = PG.ProgID
INNER JOIN TAB_ccsNetProjects PJ ON RM.ProjID = PJ.ProjID
INNER JOIN TAB_ccsNetContracts CT ON RM.ContractID = CT.ContractID
GROUP BY PG.ProgName,PJ.ProjName,CT.ContractName,
RM.RMTitle,RM.SequenceNo,RM.OrigSender,RM.DocumentDate,
RM.ReceivedDate,RM.AcknowledgedDate,RM.AdditionalInfo


RM.AdditionalInfo is the only one which is ntext datatype...

Please help thank you very much for the information.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-29 : 16:27:01
You aren't using any aggregate functions, so why not just use DISTINCT?

Tara Kizer
Go to Top of Page
   

- Advertisement -