HI I have created the below stored procedure this is working fine but fetching duplicate records with same date.
SELECT
RB.Billing_Account_ID__c AS AccountNumber,
AR.Phone__c AS PhoneNumber,
T.CreatedDate AS CreatedDate,
U.Name AS UserName,
T.[Description] AS [Description],
FROM Account AS AR
LEFT JOIN BCAccount AS RB ON AR.ID = RB.Residential_Account__c
LEFT JOIN MyTask AS T ON AR.ID = T.WhatId
LEFT JOIN [User] AS U ON T.OwnerId=U.Id
WHERE T.[Subject] = 'ABC Testing'
and BETWEEN @PastDateTime AND @CurrentDateTime
My result is displaying like below
2016-04-24 23:44:08.000
2016-04-24 23:44:08.000
2016-04-24 23:44:08.000
the above records are same and displaying as duplicate
i wnat to avoid duplicate.
Could you please help on this.
What I have tried:
I have tried to avoid duplicate by using the below things but it is not working in my select command
CONVERT(VARCHAR(10), YourDateColumn, 101),
i am getting "ntext data is not supporting distinct in sql server".