SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO


CREATE FUNCTION [dbo].[CcDateToPcDate] (@N int)  
RETURNS Datetime AS  

BEGIN 
	Declare @Result datetime
	Set @result= (cast(cast(@N-4*3600 as Decimal)/(3600*24)  + cast('1990-01-01' as datetime)  as int ) )
             If @result <= '1990-01-03' Set @result=null
	Return @Result
END






GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

