Hi Sean,
I tried writing the function
CREATE FUNCTION dbo.Convert_Date (@date_column decimal(7,0))
Returns date as begin
declare @date date
set @date = CONVERT(DATE,CASE WHEN LEFT(@date_column,1) = '1' THEN '20'
ELSE '19' END + RIGHT(@date_column,6), 112)
RETURN @date
i am getting error :
Incorrect syntax near '@date'.
And again this conversion is failing for some date columns, as there are some values '0' in those columns.
Error :Conversion failed when converting date and/or time from character string.
I wanted to make it generic, Please help with this code.
I am new to this coding.
Thanks..