I’m trying to do a statement to only select distinct records based on the legacy_call_id__c field, but I’m not sure how to do that. I am getting an error,
Msg 8163, Level 16, State 3, Line 1 The text, ntext, or image data
type cannot be selected as DISTINCT.”
SELECT DISTINCT Name, CreatedDate, clientId__c, completedDate__c
, Legacy_Call_ID__c, Description_Short__c
FROM Customers.dbo.Incident__c
WHERE Description_Short__c LIKE 'New Hire%'
OR Description_Short__c LIKE 'Term%'
I’m using SQL Server 2008R2 if that makes a difference. Thanks!
You probably have a column of type
textorntextin your select query, that is not allowed withdistinct. Change the column type tovarchar(max)instead. Or cast it directly in the queryEDIT
Not completly sure but something like this might work: