CREATE FUNCTION [dbo].[DateOnly] (@DATE DATETIME)
RETURNS DATETIME
BEGIN
    RETURN DATEADD(d, DATEDIFF(d, 0, @DATE), 0)
END

Leave a Reply