Trying to limit stored procedure results based on date I have the following stored procedure:

ALTER PROCEDURE [dbo].[TW_spRPTAllReceiverInventory] 
@SiteId varchar(50), 
@ReceiverId int,
@UserName varchar(50)

AS

BEGIN

DECLARE @SQL varchar(8000), 
        @Index int, 
        @Value varchar(500), 
        @Source varchar(100), 
        @tmp DATETIME

SELECT @Index = CHARINDEX('Initial Catalog=', ConnectionString) + 16, 
       @Value = ConnectionString
FROM   CustomerSetting
WHERE  SiteId = @SiteId

SET @Source = '[' 
               + SUBSTRING(@Value , @Index, CHARINDEX(';', @Value, @Index) - @Index) 
               + ']'

SET @SQL = 'SELECT R.SiteId, L.* FROM ' 
           + @Source 
           + '.[dbo].[vwReceiver] R JOIN ' 
           + @Source 
           + '.[dbo].[vwInventory] L ON R.ReceiverId = L.ReceiverId
        WHERE R.ReceiverId = ' 
           + CAST(@ReceiverId as varchar) 
           + ' AND L.ModifiedUserName = ' 
           + Cast(@UserName as varchar)

EXEC(@SQL)

END


What I need to do is filter the results based on one of the columns (the column is ModifiedDate, which is a DateTime column) to only show records created today. How do I accomplish this?
Here is one method for doing that.  But it only gets records that are for the current day.  If you needed for the last 24 hours, it would be slightly different.

Per suggestions in the comments, changed the query to better use any potential indexes on the base table.  However, it does assume that ModifiedDate does not contain future dates.

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[TW_spRPTAllReceiverInventory] 
@SiteId varchar(50), 
@ReceiverId int,
@UserName varchar(50)

AS

BEGIN

DECLARE @SQL varchar(8000), @Index int, @Value varchar(500), @Source varchar(100), @tmp DATETIME

SELECT @Index = CHARINDEX('Initial Catalog=', ConnectionString) + 16, @Value = ConnectionString
FROM CustomerSetting
WHERE SiteId = @SiteId

SET @Source = '[' + SUBSTRING(@Value , @Index, CHARINDEX(';', @Value, @Index) - @Index) + ']'

SET @SQL = 'SELECT R.SiteId, L.*
        FROM ' + @Source + '.[dbo].[vwReceiver] R JOIN ' + 
            @Source + '.[dbo].[vwInventory] L ON R.ReceiverId = L.ReceiverId
        WHERE R.ReceiverId = ' + CAST(@ReceiverId as varchar) + ' AND L.ModifiedUserName = ' 
            + Cast(@UserName as varchar) + ' AND ModifiedDate &gt;= CAST(CAST(GETDATE() AS DATE) AS DATETIME)'


EXEC(@SQL)

END