where CONVERT(VARCHAR(10),CreatedDateTime,111) LIKE ''' +2012-07-25 + '%''
nvarchar
The data types varchar and varchar are incompatible in the modulo operator.
CreatedDateTime
where CONVERT(VARCHAR(10),CreatedDateTime,101) LIKE '07/25/2012%'
where CONVERT(VARCHAR(10),validfromdate,111) LIKE '2012/07/25%'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)