Home Forums SQL Server 2008 SQL Server 2008 - General Issues with data format RE: Issues with data format
Ant-Green
SSC Guru
Points: 113445
More actions
December 4, 2012 at 8:06 am
#1565347
Because you are comparing a string value against a string value and the first is not less than the second, you need to ensure you use the right data types.
declare @d1 date = '12/04/2012', @d2 date = '03/01/2013'
if @d1 < @d2
select 1