I am looking for a SQL Server function to return the minimum value for datetime, namely January 1, 1753. I\'d rather not hardcode that date value into my script.
Does an
This is what I use to get the minimum date in SQL Server. Please note that it is globalisation friendly:
CREATE FUNCTION [dbo].[DateTimeMinValue]() RETURNS datetime AS BEGIN RETURN (SELECT CAST('17530101' AS datetime)) END
Call using:
SELECT [dbo].[DateTimeMinValue]()