try this for date experiance,
--By Rajat Bhalla
ALTER FUNCTION [dbo].[fnGetDateDiffAsYMD] (@FromDate AS DateTime,@ToDate AS DATETIME)
--Year,Date and Month section modified By ---------------Rajat Bhalla--------------------
RETURNS VARCHAR(30)
AS
...