Feeds:
Posts
Comments

Posts Tagged ‘Extraction’

-- SQL Server 2000/2005 (or 2008)
SELECT convert(CHAR(12), GETDATE(), 114) -- This is more widely used

SELECT DATEADD(Day, 0 - DATEDIFF(Day, 0, GetDate()), GetDate()) -- Retaining DateTime format

-- SQL Server 2008
SELECT CONVERT(TIME, GETDATE()) AS HourMinuteSecond
	,CONVERT(DATE, GETDATE(), 101) AS DateOnly

Advertisements

Read Full Post »