SQL自定义函数求当天最小时间和最大时间

二个SQL自定义函数。求当天最小时间和最大时间
CREATE FUNCTION f_GetThisDayBeginTime
(
 @datetime datetime
)
RETURNS datetime

AS
BEGIN
 RETURN convert(datetime,CONVERT(varchar(10),@datetime,120))
END



CREATE FUNCTION [dbo].[f_GetThisDayEndTime]
(
 @datetime datetime
)
RETURNS datetime
AS
BEGIN
 SET @datetime=CONVERT(VARCHAR(10),@datetime,120)+' 23:59:59.999'
    RETURN(@datetime)
END

posted @ 2007-03-14 14:43  天纯蓝  阅读(1773)  评论(0编辑  收藏  举报