开发ERP时,会使用到下面两个获取最大值或最小值日期的函数。
最大日期值:
MaximumDateValue
CREATE FUNCTION [dbo].[MaximumDateValue]
(
)
RETURNS DATETIME
AS
BEGIN
RETURN CONVERT(DATETIME, \'9999-12-31 23:59:59.998\', 121)
END
(
)
RETURNS DATETIME
AS
BEGIN
RETURN CONVERT(DATETIME, \'9999-12-31 23:59:59.998\', 121)
END
最小日期值:
MinimumDateValue
CREATE FUNCTION [dbo].[MinimumDateValue]
(
)
RETURNS DATETIME
AS
BEGIN
RETURN CONVERT(DATETIME, \'1753-01-01\', 121)
END
(
)
RETURNS DATETIME
AS
BEGIN
RETURN CONVERT(DATETIME, \'1753-01-01\', 121)
END