$ 0 0 Sorry,it should be when isdate(v.value)=1and v.value isnotnulland rtrim(ltrim(v.value))<>''then cast(v.value as datetime)