--获取最小: --方法1: CREATE FUNCTION [dbo].[MinimumDateValue] ( ) RETURNS DATETIME AS BEGIN RETURN CONVERT(DATETIME, '1753-01-01', 121) END --方法2: declare @Date smalldatetime set @Date=0 select @Date --获取最大 CREATE FUNCTION [dbo].[MaximumDateValue] ( ) RETURNS DATETIME AS BEGIN RETURN CONVERT(DATETIME, '9999-12-31 23:59:59.998', 121) END