• river1 (6/19/2014)


    Hi,

    I have this t-sql

    CONVERT(VARCHAR(10),dt_inicio,105) >= CONVERT(VARCHAR(10),'01-01-2013',105)

    the comparation is not correct because I'm comparing strings.

    I would like to compare the day, month and year of the two dates.

    How can I do this?

    thank you

    If the data type of the column dt_inicio is datetime why not just do this:

    ...

    WHERE

    dt_inico >= '20130101' -- the string value '20130101' will be implicitly converted to a date/time value of 2013-01-01 00:00:00.000