Hi, I am doing this and its giving me this error ?????
*******************************************************
Server: 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.
Server: Msg 306, Level 16, State 1, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
*****************************************************
SELECT CONTACT1.CONTACT AS Contact, CONTACT1.COMPANY AS Company, CONTACT1.ADDRESS1 AS Address1,
CONTACT1.ADDRESS2 AS Address2, CONTACT1.ADDRESS3 AS Address3, CONTACT1.CITY AS City,
CONTACT1.STATE AS State, CONTACT1.ZIP AS Zip, CONTACT1.COUNTRY AS Country, CONTACT1.TITLE AS Job_Title,
CONTACT1.PHONE1 AS Direct_Line, CONTACT1.KEY3 AS OSA, CONTACT2.UCONTCTROL AS Contacts_Role,
cast(CONTSUPP.notes as varchar) As Notes,
min(contsupp.rectype) as Rectype, min(CONTSUPP.CONTSUPREF) AS Email
FROM CONTACT1 INNER JOIN CONTACT2 ON CONTACT1.ACCOUNTNO = CONTACT2.ACCOUNTNO
LEFT OUTER JOIN CONTSUPP ON CONTACT2.ACCOUNTNO = CONTSUPP.ACCOUNTNO
WHERE CONTACT1.CONTACT like '*main%'
GROUP BY CONTACT1.CONTACT, CONTACT1.COMPANY, CONTACT1.ADDRESS1, CONTACT1.ADDRESS2, CONTACT1.ADDRESS3,
CONTACT1.CITY, CONTACT1.STATE, CONTACT1.ZIP, CONTACT1.COUNTRY, CONTACT1.TITLE,
CONTACT1.PHONE1, CONTACT1.KEY3, CONTACT2.UCONTCTROL, CONTSUPP.notes
*******************************************************
Server: 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.
Server: Msg 306, Level 16, State 1, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
*****************************************************
SELECT CONTACT1.CONTACT AS Contact, CONTACT1.COMPANY AS Company, CONTACT1.ADDRESS1 AS Address1,
CONTACT1.ADDRESS2 AS Address2, CONTACT1.ADDRESS3 AS Address3, CONTACT1.CITY AS City,
CONTACT1.STATE AS State, CONTACT1.ZIP AS Zip, CONTACT1.COUNTRY AS Country, CONTACT1.TITLE AS Job_Title,
CONTACT1.PHONE1 AS Direct_Line, CONTACT1.KEY3 AS OSA, CONTACT2.UCONTCTROL AS Contacts_Role,
cast(CONTSUPP.notes as varchar) As Notes,
min(contsupp.rectype) as Rectype, min(CONTSUPP.CONTSUPREF) AS Email
FROM CONTACT1 INNER JOIN CONTACT2 ON CONTACT1.ACCOUNTNO = CONTACT2.ACCOUNTNO
LEFT OUTER JOIN CONTSUPP ON CONTACT2.ACCOUNTNO = CONTSUPP.ACCOUNTNO
WHERE CONTACT1.CONTACT like '*main%'
GROUP BY CONTACT1.CONTACT, CONTACT1.COMPANY, CONTACT1.ADDRESS1, CONTACT1.ADDRESS2, CONTACT1.ADDRESS3,
CONTACT1.CITY, CONTACT1.STATE, CONTACT1.ZIP, CONTACT1.COUNTRY, CONTACT1.TITLE,
CONTACT1.PHONE1, CONTACT1.KEY3, CONTACT2.UCONTCTROL, CONTSUPP.notes