>If you create a where like
>
> (@MinDate is null OR @MinDate < = Date) and
> (@MaxDate is null OR @MaxDate > = Date) and
> (@MinAmount is null OR @MinAmount > = Amount) and
>
>SQL is doing a lot of extra work internally. If you construct the query dynamically so that in the case where @MinAmount is not passed you execute
>
> (@MinDate is null OR @MinDate < = Date) and
> (@MaxDate is null OR @MaxDate > = Date)
>
>The optimizer will not waste time even thinking about MinAmount. :)
You lost me here. I am trying to find the reference where I have to make an adjustment. Also, putting the parameter to left is highly confusing.