MSSQL GetDateOnly

  • Function returns date part of the datetime.
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Tomas Borovicka
-- Create date: 14.4.2009
-- Description:	<Description, ,>
-- =============================================
ALTER FUNCTION [dbo].[GetDateOnly](@DATE DATETIME)
RETURNS DATETIME
AS
BEGIN
	RETURN CONVERT(datetime,CONVERT(VARCHAR(25), @DATE, 104),104)
END
programming/mssql/getdateonly.txt · Last modified: 2018-06-21 19:48 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0