[dba-SQLServer] SQL Server date functions

Arthur Fuller fuller.artful at gmail.com
Tue Mar 18 13:40:34 CDT 2008


Just for completeness, JC, here's a function to grab just the time part,
called (gasp) TimePart(). Where do I come up with these names?

<code>
CREATE FUNCTION [dbo].[TimePart]
  ( @fDate datetime )
RETURNS varchar(10)
AS
BEGIN
  RETURN ( CONVERT(varchar(7),right(@fDate,7),101) )
END
</code>

Arthur



More information about the dba-SQLServer mailing list