This function return a varchar with the date and time from a datetime parameter.
The string returned is in french but can be adapted in other language.
CREATE FUNCTION [dbo].[ConvertDateToVarchar] ( @Date DateTime ) RETURNS TABLE AS RETURN ( SELECT DateStr = CASE WHEN @Date Is Null THEN 'Jamais' WHEN (DatePart(hour, @Date) = 0 AND DatePart(Minute, @date) = 0) THEN CONVERT(VARCHAR, @Date, 105) ELSE CONVERT(VARCHAR, @Date, 105) + ' à ' + REPLACE(CONVERT(VARCHAR(5), @Date, 108),':', 'h') END )