• and add some function to limit the records - such as

    where convert(date,mydatecolumn)=convert(date,@red)

    MVDBA