Replace:
SET @AttndDate = CONVERT(VARCHAR, getdate(), 103)
with:
SET @AttnDate = DATEADD(dd, DATEDIFF(dd, 0, getdate()), 0)
to reject/remove time part then change
WHERE
condition to:
WHERE AttndDate BETWEEN @AttndDate AND DATEADD(ss, -1, DATEADD(dd, 1, @AttndDate))
DateAdd (SQL)[
^]
[EDIT]
ALTER PROCEDURE [dbo].[SelectRCOByDate]
@Username Varchar (50)=NULL,
@AttndDate DateTime = NULL
AS
BEGIN
SET NOCOUNT ON;
SET DATETIMEFORMAT dmy;
IF @AttndDate is null SET @AttndDate = GETDATE()
SET @AttndDate = DATEADD(dd, DATEDIFF(dd, 0, @AttndDate), @AttndDate)
DECLARE @AttEndDate DATETIME = DATEADD(dd, -1, DATEADD(ss, -1, @AttndDate))
SELECT r.Username AS Username, r.surname AS Surname, r.firstname AS Firstname,u.branch AS Branch, r.RTime AS ResumptionTime,r.CTime AS ClosureTime, CONVERT(VARCHAR, r.ATTNDDate, 103) AS ATTNDATE
FROM RCORegister r
INNER JOIN UserMgmt u ON r.Username = u.Username
WHERE r.ATTNDDate >= @AttndDate AND r.ATTNDDate <= @AttEndDate
ORDER BY r.ATTNDDate DESC
END
[/EDIT]