I'm testing some SQL query for return value.
The table I'm selecting from has a value NULL
in a CloseDate
field.
I have a logic that checks if it is NULL
, return an empty string. However, it returns 01/01/1900
declare @value varchar(50) = '2346677888'
Set @Value=@Value +'%'
select CONVERT(varchar,ISNULL(m.CloseDate,''),101) as CloseDate from(
SELECT m.EdsClosedDate AS CloseDate
FROM [dbo].[tblMyTable] m
WHERE MID like @value) m
What's wrong with the query?