• Use default values for your parameters and then check if any have been changed...

    The following is untested but will give you an idea:

    Create Procedure proc1

    @p1 int =1,

    @p2 int =1

    AS

    Select * from table

    where date1 >= DATEADD(Day, DATEDIFF(Day, 0, getdate()-1), 0)

    and date1 < DATEADD(Day, DATEDIFF(Day, 0, getdate()), 0)

    and (col1 = @p1 or @p1=1 )

    AND (col2 = @p2 or @p2=1)

    In this code, if the parameter is 1 (the default) then every record will be true. If the parameter is changed then it will start to filter.

    Bevan Keighley