• It is a string comparation.

    Dates comparation might be:

    IF (CAST( '2011-07-31 00:00:00.000' AS DATETIME) BETWEEN CAST( '2011-07-01' AS DATETIME) and CAST( '2011-07-31' AS DATETIME) )

    PRINT 'Yes'

    ELSE

    PRINT 'No'

    Regards,

    Iulian