• Lowell (8/28/2015)


    my example i provided made sure the valuewas converted to date type. As Luis pointed out, converting the date to a string in this format:2015-04-01 is now ten characters, with it getting truncated due to your varchar(8) variable.

    dates should stay as dates. if your procedure accepts a date or datetime value, send it a datetime value...don't convert to a string that you think looks nice.

    keep datetime as datetime.

    show us your actual code, and you can get some solid peer review form experienced volunteers here.

    Except that it's impossible to pass multiple dates in one date-type parameter. That's the reason for converting the data to varchar.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.