You can use something like this with Sql Server
CREATE FUNCTION [dbo].[udf_DateOnly](@DateTime DATETIME)
RETURNS DATETIME
AS
BEGIN
RETURN DATEADD(dd,0, DATEDIFF(dd,0,@DateTime))
END
This line
DATEADD(dd,0, DATEDIFF(dd,0,@DateTime))
will strip out the Date portion.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…