Create a stored procedure like shown below, and pass in the parameters when you call the stored proc. If you don't pass in one or both parameter(s), it will assume not filter by that criterion.CREATE PROCEDURE dbo.SomeProcedure @StartDate DATE = NULL, @EndDate DATE = NULL -- inclusiveASSELECT col1, col2, col3FROM yourTableWHERE ( YourDateCol >= @StartDate OR @StartDate IS NULL) AND ( YourDateCol < DATEADD(dd,1,@EndDate) OR @EndDate IS NULL);GO