Hi all, I am trying to output the records less than current day, however I am getting an err:The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.;WITH NewValues AS(select uid_person,PersonnelNumber,FirstName,LastName,CustomProperty10,del_end_date= dbo.fn__SplitValue(CustomProperty10,'--',2) from Person where ---CustomProperty09 is null and CustomProperty10 is not nulland IsInActive =0----and CustomProperty10 not like '%2011%'and ( XDateUpdated between convert(varchar,DATEADD(d,-15,getutcdate()),1) and convert(varchar,getutcdate(),1) ))select ---convert(datetime,rtrim(ltrim(del_end_date)),20),convert(datetime,getdate(),20),* from NewValues p,UNSAccountB u where u.UID_Person = p.UID_Personand u.AccountDisabled = 0and p.del_end_date like '%2012%' and convert(datetime,rtrim(ltrim(p.del_end_date)),21) < getdate()order by p.del_end_date desc