<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Get Time in Hour:Minute Format from a Datetime &#8211; Get Date Part Only from Datetime</title>
	<atom:link href="http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 26 May 2013 09:05:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: sagar</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-480394</link>
		<dc:creator><![CDATA[sagar]]></dc:creator>
		<pubDate>Wed, 22 May 2013 09:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-480394</guid>
		<description><![CDATA[03:07:30.8570000 i got this as time and what is this &quot;8570000&quot; here...??]]></description>
		<content:encoded><![CDATA[<p>03:07:30.8570000 i got this as time and what is this &#8220;8570000&#8243; here&#8230;??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: me</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-455187</link>
		<dc:creator><![CDATA[me]]></dc:creator>
		<pubDate>Sat, 13 Apr 2013 13:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-455187</guid>
		<description><![CDATA[I need to get the number of hours from two date formats.. i.e i need to get number of hours spent by a staff on a project i have decidded to use start time and end time.. solution? :).]]></description>
		<content:encoded><![CDATA[<p>I need to get the number of hours from two date formats.. i.e i need to get number of hours spent by a staff on a project i have decidded to use start time and end time.. solution? :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glyn Roberts</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-445612</link>
		<dc:creator><![CDATA[Glyn Roberts]]></dc:creator>
		<pubDate>Wed, 27 Mar 2013 23:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-445612</guid>
		<description><![CDATA[I wanted to be able to format dates in a similar way to the VB6 FORMAT() function where you give it a date and a picture of the date and it returns a string in that format.
I have written this as a SQL function and use it quite often

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(&#039;Format&#039;) AND type in (N&#039;FN&#039;, N&#039;IF&#039;, N&#039;TF&#039;, N&#039;FS&#039;, N&#039;FT&#039;)) DROP FUNCTION Format
GO

Create Function Format(@Date DateTime,@Fmt Char(30)) Returns Char(30) as 
Begin 
	-- @Fmt can be dd/mm/yyyy, yyyy-mm-dd, dd-mmm-yyyy, dd/mm/yy, ddd dd/mm/yyyy, dddd dd-mmmm-yyyy, dddd mmmm dd, yyyy etc
	-- @Fmt can also include HH:mm, HH:mm:ss, HH:mm:ss:ttt formats - always in 24 hour format at this stage	
	-- FD is First Day-of-month, LD is Last Day-of-month, FYYY is financial year, FM is month in financial year, MN is minutes of hour
	
	Select @Fmt=Replace(@Fmt,&#039;FD&#039;,&#039;01&#039;);	
	Select @Fmt=Replace(@Fmt,&#039;LD&#039;,right(rtrim(cast(100+Day(DateAdd(Day,-1,DateAdd(Month,1,DateAdd(Day,1-Day(@Date),@Date)))) as Char(3))),2));	
	Select @Fmt=Replace(@Fmt,&#039;FM&#039;,Right(RTrim(Cast(100+Case When Month(@Date)&gt;6 then Month(@Date)-6 else Month(@Date)+6 End as char(3))),2));
	Select @Fmt=Replace(@Fmt,&#039;FYYY&#039;,Right(RTrim(Cast(10000+Case When Month(@Date)&gt;6 then Year(@Date) else Year(@Date)-1 End as char(5))),4));
	Select @Fmt=Replace(@Fmt,&#039;FY&#039;,Right(RTrim(Cast(10000+Case When Month(@Date)&gt;6 then Year(@Date) else Year(@Date)-1 End as char(5))),2));	
	Select @Fmt=Replace(@Fmt,&#039;HH&#039;,left(Cast(Cast(@Date as Time) as char(10)),2));
	Select @Fmt=Replace(@Fmt,&#039;:MM&#039;,SubString(Cast(Cast(@Date as Time) as char(12)),3,3));
	Select @Fmt=Replace(@Fmt,&#039;MN&#039;,SubString(Cast(Cast(@Date as Time) as char(12)),4,2));
	Select @Fmt=Replace(@Fmt,&#039;SS&#039;,SubString(Cast(Cast(@Date as Time) as char(12)),7,2));
	Select @Fmt=Replace(@Fmt,&#039;TTT&#039;,SubString(Cast(Cast(@Date as Time) as char(12)),10,3));
	Select @Fmt=Replace(@Fmt,&#039;TT&#039;,SubString(Cast(Cast(@Date as Time) as char(12)),10,2));
	Select @Fmt=Replace(@Fmt,&#039;DDDD&#039;,DATENAME(dw,@Date));
	Select @Fmt=Replace(@Fmt,&#039;DDD&#039;,Left(DATENAME(dw,@Date),3));
	Select @Fmt=Replace(@Fmt,&#039;DD&#039;,Right(Rtrim(cast(100+day(@Date) as Char(3))),2));
	Select @Fmt=Replace(@Fmt,&#039;MMMM&#039;,DATENAME(month,@Date));
	Select @Fmt=Replace(@Fmt,&#039;MMM&#039;,Left(DATENAME(month,@Date),3));
	Select @Fmt=Replace(@Fmt,&#039;MM&#039;,Right(Rtrim(cast(100+month(@Date) as Char(3))),2));
	Select @Fmt=Replace(@Fmt,&#039;YYYY&#039;,Right(Rtrim(cast(10000+Year(@Date) as Char(5))),4));
	Select @Fmt=Replace(@Fmt,&#039;YY&#039;,Right(Rtrim(cast(10000+Year(@Date) as Char(6))),2));	
	Return ltrim(rtrim(@Fmt));
End 
GO
SELECT getdate(),
dbo.Format(getDate(),&#039;ddd dd-mmm-yyyy HH:mm:ss.ttt&#039;),
dbo.Format(getDate(),&#039;HH:mn&#039;),
dbo.Format(getDate(),&#039;fd-mmm-yyyy&#039;),
dbo.Format(getDate(),&#039;LD-mmm-yyyy&#039;),
dbo.Format(GetDate(),&#039;FYYY-FM&#039;);]]></description>
		<content:encoded><![CDATA[<p>I wanted to be able to format dates in a similar way to the VB6 FORMAT() function where you give it a date and a picture of the date and it returns a string in that format.<br />
I have written this as a SQL function and use it quite often</p>
<p>IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(&#8216;Format&#8217;) AND type in (N&#8217;FN&#8217;, N&#8217;IF&#8217;, N&#8217;TF&#8217;, N&#8217;FS&#8217;, N&#8217;FT&#8217;)) DROP FUNCTION Format<br />
GO</p>
<p>Create Function Format(@Date DateTime,@Fmt Char(30)) Returns Char(30) as<br />
Begin<br />
	&#8211; @Fmt can be dd/mm/yyyy, yyyy-mm-dd, dd-mmm-yyyy, dd/mm/yy, ddd dd/mm/yyyy, dddd dd-mmmm-yyyy, dddd mmmm dd, yyyy etc<br />
	&#8211; @Fmt can also include HH:mm, HH:mm:ss, HH:mm:ss:ttt formats &#8211; always in 24 hour format at this stage<br />
	&#8211; FD is First Day-of-month, LD is Last Day-of-month, FYYY is financial year, FM is month in financial year, MN is minutes of hour</p>
<p>	Select @Fmt=Replace(@Fmt,&#8217;FD&#8217;,&#8217;01&#8242;);<br />
	Select @Fmt=Replace(@Fmt,&#8217;LD&#8217;,right(rtrim(cast(100+Day(DateAdd(Day,-1,DateAdd(Month,1,DateAdd(Day,1-Day(@Date),@Date)))) as Char(3))),2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;FM&#8217;,Right(RTrim(Cast(100+Case When Month(@Date)&gt;6 then Month(@Date)-6 else Month(@Date)+6 End as char(3))),2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;FYYY&#8217;,Right(RTrim(Cast(10000+Case When Month(@Date)&gt;6 then Year(@Date) else Year(@Date)-1 End as char(5))),4));<br />
	Select @Fmt=Replace(@Fmt,&#8217;FY&#8217;,Right(RTrim(Cast(10000+Case When Month(@Date)&gt;6 then Year(@Date) else Year(@Date)-1 End as char(5))),2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;HH&#8217;,left(Cast(Cast(@Date as Time) as char(10)),2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;:MM&#8217;,SubString(Cast(Cast(@Date as Time) as char(12)),3,3));<br />
	Select @Fmt=Replace(@Fmt,&#8217;MN&#8217;,SubString(Cast(Cast(@Date as Time) as char(12)),4,2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;SS&#8217;,SubString(Cast(Cast(@Date as Time) as char(12)),7,2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;TTT&#8217;,SubString(Cast(Cast(@Date as Time) as char(12)),10,3));<br />
	Select @Fmt=Replace(@Fmt,&#8217;TT&#8217;,SubString(Cast(Cast(@Date as Time) as char(12)),10,2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;DDDD&#8217;,DATENAME(dw,@Date));<br />
	Select @Fmt=Replace(@Fmt,&#8217;DDD&#8217;,Left(DATENAME(dw,@Date),3));<br />
	Select @Fmt=Replace(@Fmt,&#8217;DD&#8217;,Right(Rtrim(cast(100+day(@Date) as Char(3))),2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;MMMM&#8217;,DATENAME(month,@Date));<br />
	Select @Fmt=Replace(@Fmt,&#8217;MMM&#8217;,Left(DATENAME(month,@Date),3));<br />
	Select @Fmt=Replace(@Fmt,&#8217;MM&#8217;,Right(Rtrim(cast(100+month(@Date) as Char(3))),2));<br />
	Select @Fmt=Replace(@Fmt,&#8217;YYYY&#8217;,Right(Rtrim(cast(10000+Year(@Date) as Char(5))),4));<br />
	Select @Fmt=Replace(@Fmt,&#8217;YY&#8217;,Right(Rtrim(cast(10000+Year(@Date) as Char(6))),2));<br />
	Return ltrim(rtrim(@Fmt));<br />
End<br />
GO<br />
SELECT getdate(),<br />
dbo.Format(getDate(),&#8217;ddd dd-mmm-yyyy HH:mm:ss.ttt&#8217;),<br />
dbo.Format(getDate(),&#8217;HH:mn&#8217;),<br />
dbo.Format(getDate(),&#8217;fd-mmm-yyyy&#8217;),<br />
dbo.Format(getDate(),&#8217;LD-mmm-yyyy&#8217;),<br />
dbo.Format(GetDate(),&#8217;FYYY-FM&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankush</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-427205</link>
		<dc:creator><![CDATA[Ankush]]></dc:creator>
		<pubDate>Mon, 25 Feb 2013 06:16:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-427205</guid>
		<description><![CDATA[SELECT * FROM TimeDiff(&#039;10:15:45&#039;,&#039;14:00:15&#039;)

Result

ID	TimeDiff
1	03:44:30.0000000]]></description>
		<content:encoded><![CDATA[<p>SELECT * FROM TimeDiff(&#8217;10:15:45&#8242;,&#8217;14:00:15&#8242;)</p>
<p>Result</p>
<p>ID	TimeDiff<br />
1	03:44:30.0000000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankush</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-427201</link>
		<dc:creator><![CDATA[Ankush]]></dc:creator>
		<pubDate>Mon, 25 Feb 2013 06:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-427201</guid>
		<description><![CDATA[I wrote a small function which returns you table having Time Diffence as on of its attribute. Function is as follow:-

CREATE FUNCTION dbo.TimeDiff (@STARTDATE datetime,@ENDDATE datetime)

  RETURNS @TIMEDIFF TABLE (ID int IDENTITY(1, 1) NOT NULL, TimeDiff TIME NULL) AS

BEGIN
	
	DECLARE @24DATE DATETIME
	SET @24DATE = &#039;23:59:59.000&#039;

	IF (@STARTDATE &gt; @ENDDATE)
	INSERT INTO @TIMEDIFF
	SELECT DATEADD (SECOND,1, CONVERT(TIME(0), ( @24DATE -(@ENDDATE - @STARTDATE))))
	ELSE
	INSERT INTO @TIMEDIFF
	SELECT CONVERT(TIME(0), ( (@ENDDATE - @STARTDATE)))

RETURN
END

GO]]></description>
		<content:encoded><![CDATA[<p>I wrote a small function which returns you table having Time Diffence as on of its attribute. Function is as follow:-</p>
<p>CREATE FUNCTION dbo.TimeDiff (@STARTDATE datetime,@ENDDATE datetime)</p>
<p>  RETURNS @TIMEDIFF TABLE (ID int IDENTITY(1, 1) NOT NULL, TimeDiff TIME NULL) AS</p>
<p>BEGIN</p>
<p>	DECLARE @24DATE DATETIME<br />
	SET @24DATE = &#8217;23:59:59.000&#8242;</p>
<p>	IF (@STARTDATE &gt; @ENDDATE)<br />
	INSERT INTO @TIMEDIFF<br />
	SELECT DATEADD (SECOND,1, CONVERT(TIME(0), ( @24DATE -(@ENDDATE &#8211; @STARTDATE))))<br />
	ELSE<br />
	INSERT INTO @TIMEDIFF<br />
	SELECT CONVERT(TIME(0), ( (@ENDDATE &#8211; @STARTDATE)))</p>
<p>RETURN<br />
END</p>
<p>GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-421306</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 13 Feb 2013 09:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-421306</guid>
		<description><![CDATA[select dateadd(hour,datediff(hour,0,date_col),0) from your_table]]></description>
		<content:encoded><![CDATA[<p>select dateadd(hour,datediff(hour,0,date_col),0) from your_table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-421270</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 13 Feb 2013 08:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-421270</guid>
		<description><![CDATA[SUM will work only form number datatypes]]></description>
		<content:encoded><![CDATA[<p>SUM will work only form number datatypes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ARUNPANDIAN</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-420578</link>
		<dc:creator><![CDATA[ARUNPANDIAN]]></dc:creator>
		<pubDate>Mon, 11 Feb 2013 10:38:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-420578</guid>
		<description><![CDATA[sir how to find sum (datetime) for group by operation]]></description>
		<content:encoded><![CDATA[<p>sir how to find sum (datetime) for group by operation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: varungaur</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-419097</link>
		<dc:creator><![CDATA[varungaur]]></dc:creator>
		<pubDate>Thu, 07 Feb 2013 13:05:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-419097</guid>
		<description><![CDATA[Hi ALL,
i want to convert dateformat &#039;2013-01-15 11:23:34.930&#039;  into 2013-01-15 11:00:00.000 this format please help.]]></description>
		<content:encoded><![CDATA[<p>Hi ALL,<br />
i want to convert dateformat &#8217;2013-01-15 11:23:34.930&#8242;  into 2013-01-15 11:00:00.000 this format please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: varungaur</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-419096</link>
		<dc:creator><![CDATA[varungaur]]></dc:creator>
		<pubDate>Thu, 07 Feb 2013 13:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-419096</guid>
		<description><![CDATA[Hi 
I want to convert  &#039;2013-01-15 11:23:49.930&#039; 

output =&#039;2013-01-15 11:00:00.000&#039;
Please help.]]></description>
		<content:encoded><![CDATA[<p>Hi<br />
I want to convert  &#8217;2013-01-15 11:23:49.930&#8242; </p>
<p>output =&#8217;2013-01-15 11:00:00.000&#8242;<br />
Please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammed Asif</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-402621</link>
		<dc:creator><![CDATA[Mohammed Asif]]></dc:creator>
		<pubDate>Wed, 02 Jan 2013 07:28:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-402621</guid>
		<description><![CDATA[Dear All,

Can any one help me,

i have two columns of one table as @ABC as DateTime and @xyz as DateTime - Datatype

i want to subtract only time and i am trying like this 

for ABC = 21/02/2012 6:10:00 PM and XYZ = 01/01/2001 12:00:00 AM -&gt; 1st Row

 CONVERT(varchar(10), dbo.checkingtime.ABC - dbo.checkingtime.XYZ, 108) 

and i am getting the result as 18:10 but i want the result as 05:50  in Hours and Minutes only

is it possible ? ? ?

Awaiting from the HelpingNature People]]></description>
		<content:encoded><![CDATA[<p>Dear All,</p>
<p>Can any one help me,</p>
<p>i have two columns of one table as @ABC as DateTime and @xyz as DateTime &#8211; Datatype</p>
<p>i want to subtract only time and i am trying like this </p>
<p>for ABC = 21/02/2012 6:10:00 PM and XYZ = 01/01/2001 12:00:00 AM -&gt; 1st Row</p>
<p> CONVERT(varchar(10), dbo.checkingtime.ABC &#8211; dbo.checkingtime.XYZ, 108) </p>
<p>and i am getting the result as 18:10 but i want the result as 05:50  in Hours and Minutes only</p>
<p>is it possible ? ? ?</p>
<p>Awaiting from the HelpingNature People</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Display Datetime in Specific Format &#8211; SQL in Sixty Seconds #033 &#8211; Video &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-377766</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Display Datetime in Specific Format &#8211; SQL in Sixty Seconds #033 &#8211; Video &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 01:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-377766</guid>
		<description><![CDATA[[...] Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: javed</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-361157</link>
		<dc:creator><![CDATA[javed]]></dc:creator>
		<pubDate>Wed, 17 Oct 2012 14:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-361157</guid>
		<description><![CDATA[i want 10-OCT-2012 10:50:10 PM]]></description>
		<content:encoded><![CDATA[<p>i want 10-OCT-2012 10:50:10 PM</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Get Date and Time From Current DateTime &#8211; SQL in Sixty Seconds #025 &#8211; Video &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-343001</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Get Date and Time From Current DateTime &#8211; SQL in Sixty Seconds #025 &#8211; Video &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Wed, 12 Sep 2012 01:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-343001</guid>
		<description><![CDATA[[...] Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laxman Mankala</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-336234</link>
		<dc:creator><![CDATA[Laxman Mankala]]></dc:creator>
		<pubDate>Thu, 23 Aug 2012 10:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-336234</guid>
		<description><![CDATA[SELECT CONVERT(VARCHAR(19), GETDATE(), 1) 
+ &#039; &#039; + 
RIGHT(CONVERT(VARCHAR(17), GETDATE(), 9),5)
--REPLACE(RIGHT(CONVERT(VARCHAR(50), GETDATE(), 100),7),RIGHT(RIGHT(CONVERT(VARCHAR(50), GETDATE(), 100),7),2),&#039;&#039;) 
+&#039; &#039;+ 
RIGHT(CONVERT(VARCHAR(19), GETDATE(), 100),2)AS &#039;Date&#039;

Result will be : &lt;b&gt; 08/23/12  4:16 PM &lt;/b&gt;]]></description>
		<content:encoded><![CDATA[<p>SELECT CONVERT(VARCHAR(19), GETDATE(), 1)<br />
+ &#8216; &#8216; +<br />
RIGHT(CONVERT(VARCHAR(17), GETDATE(), 9),5)<br />
&#8211;REPLACE(RIGHT(CONVERT(VARCHAR(50), GETDATE(), 100),7),RIGHT(RIGHT(CONVERT(VARCHAR(50), GETDATE(), 100),7),2),&#8221;)<br />
+&#8217; &#8216;+<br />
RIGHT(CONVERT(VARCHAR(19), GETDATE(), 100),2)AS &#8216;Date&#8217;</p>
<p>Result will be : <b> 08/23/12  4:16 PM </b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaun</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-322628</link>
		<dc:creator><![CDATA[Shaun]]></dc:creator>
		<pubDate>Tue, 31 Jul 2012 21:58:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-322628</guid>
		<description><![CDATA[I have a table with a datetime field, and I would like to find just records from today, after 10:15am. 

I have :

where TIME_STAMP &gt;= cast(floor(cast(GETDATE() as float)) as datetime) 
and LEFT(CONVERT(TIME(2),TIME_STAMP) ,5) &gt; &#039;10:15&#039;

which works fine in SQL Server 10, but our prod database is SQL Server 9. 

Any ideas on an efficient way to do this?]]></description>
		<content:encoded><![CDATA[<p>I have a table with a datetime field, and I would like to find just records from today, after 10:15am. </p>
<p>I have :</p>
<p>where TIME_STAMP &gt;= cast(floor(cast(GETDATE() as float)) as datetime)<br />
and LEFT(CONVERT(TIME(2),TIME_STAMP) ,5) &gt; &#8217;10:15&#8242;</p>
<p>which works fine in SQL Server 10, but our prod database is SQL Server 9. </p>
<p>Any ideas on an efficient way to do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Purna Magum</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-318801</link>
		<dc:creator><![CDATA[Purna Magum]]></dc:creator>
		<pubDate>Wed, 25 Jul 2012 09:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-318801</guid>
		<description><![CDATA[To get the response like 3:16PM

SELECT RIGHT(LTRIM(RIGHT(Convert(varchar,GETDATE(),100),8)),8) AS ONLY_TIME]]></description>
		<content:encoded><![CDATA[<p>To get the response like 3:16PM</p>
<p>SELECT RIGHT(LTRIM(RIGHT(Convert(varchar,GETDATE(),100),8)),8) AS ONLY_TIME</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john_279@hotmail.com</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-315949</link>
		<dc:creator><![CDATA[john_279@hotmail.com]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 16:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-315949</guid>
		<description><![CDATA[This is a BAD solution - converting to a string and hoping to accurately lop off the time portion with a substring, then converting it back, is a HACK.]]></description>
		<content:encoded><![CDATA[<p>This is a BAD solution &#8211; converting to a string and hoping to accurately lop off the time portion with a substring, then converting it back, is a HACK.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-313000</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 13 Jul 2012 11:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-313000</guid>
		<description><![CDATA[Try this

declare @startTime varchar(10),@endTime varchar(10)
select @startTime =&#039;10:00 AM&#039;, @endtime =&#039;7:30 PM&#039;
select convert(varchar(10),@endtime-cast(@starttime as datetime),108)]]></description>
		<content:encoded><![CDATA[<p>Try this</p>
<p>declare @startTime varchar(10),@endTime varchar(10)<br />
select @startTime =&#8217;10:00 AM&#8217;, @endtime =&#8217;7:30 PM&#8217;<br />
select convert(varchar(10),@endtime-cast(@starttime as datetime),108)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel S. Gurrola II</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-312692</link>
		<dc:creator><![CDATA[Daniel S. Gurrola II]]></dc:creator>
		<pubDate>Thu, 12 Jul 2012 18:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-312692</guid>
		<description><![CDATA[SELECT
LEFT(CONVERT(TIME(0),GETDATE()) ,5) AS [HourMinuteSecond]
GO
/*
HourMinuteSecond
------------------------
10:48
*/

and as an added bonus that converting a date/time value to VarChar does not offer, you can still add this result with time...(above +10 mins below)

SELECT
LEFT(DATEADD(mi, 10, (CONVERT(TIME(0),GETDATE()))),5) AS [HourMinuteSecond]
GO
/*
HourMinuteSecond
------------------------
10:58
*/


Daniel S. Gurrola II
No Acronyms, Affiliations, Certifications or other Nausea - it&#039;s just...me.]]></description>
		<content:encoded><![CDATA[<p>SELECT<br />
LEFT(CONVERT(TIME(0),GETDATE()) ,5) AS [HourMinuteSecond]<br />
GO<br />
/*<br />
HourMinuteSecond<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
10:48<br />
*/</p>
<p>and as an added bonus that converting a date/time value to VarChar does not offer, you can still add this result with time&#8230;(above +10 mins below)</p>
<p>SELECT<br />
LEFT(DATEADD(mi, 10, (CONVERT(TIME(0),GETDATE()))),5) AS [HourMinuteSecond]<br />
GO<br />
/*<br />
HourMinuteSecond<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
10:58<br />
*/</p>
<p>Daniel S. Gurrola II<br />
No Acronyms, Affiliations, Certifications or other Nausea &#8211; it&#8217;s just&#8230;me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Priyalakshmi</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-312099</link>
		<dc:creator><![CDATA[Priyalakshmi]]></dc:creator>
		<pubDate>Wed, 11 Jul 2012 07:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-312099</guid>
		<description><![CDATA[I have a similar requirement but I need the difference of minutes also.
That is, I have startTime as varchar 
                       endTime as varchar

Values are 10:00 AM and 7:30 PM
I need to find the difference between these two times. How to do that? I tried the above said query but that gives only the difference in hours. I need the time also. In this case I need 09:30 as result.

Please help. Thanks]]></description>
		<content:encoded><![CDATA[<p>I have a similar requirement but I need the difference of minutes also.<br />
That is, I have startTime as varchar<br />
                       endTime as varchar</p>
<p>Values are 10:00 AM and 7:30 PM<br />
I need to find the difference between these two times. How to do that? I tried the above said query but that gives only the difference in hours. I need the time also. In this case I need 09:30 as result.</p>
<p>Please help. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Surendra</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-303924</link>
		<dc:creator><![CDATA[Surendra]]></dc:creator>
		<pubDate>Thu, 21 Jun 2012 11:57:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-303924</guid>
		<description><![CDATA[Good solution...Thanx Pinal]]></description>
		<content:encoded><![CDATA[<p>Good solution&#8230;Thanx Pinal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radhika</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-303110</link>
		<dc:creator><![CDATA[Radhika]]></dc:creator>
		<pubDate>Tue, 19 Jun 2012 09:07:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-303110</guid>
		<description><![CDATA[If i want only the hours and minutes and not the seconds how can i use]]></description>
		<content:encoded><![CDATA[<p>If i want only the hours and minutes and not the seconds how can i use</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sequin chapman</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-291429</link>
		<dc:creator><![CDATA[sequin chapman]]></dc:creator>
		<pubDate>Thu, 31 May 2012 06:29:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-291429</guid>
		<description><![CDATA[Pinal,

Once again you have come through with the goods. You are the man.]]></description>
		<content:encoded><![CDATA[<p>Pinal,</p>
<p>Once again you have come through with the goods. You are the man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruk</title>
		<link>http://blog.sqlauthority.com/2009/08/06/sql-server-get-time-in-hourminute-format-from-a-datetime-get-date-part-only-from-datetime/#comment-279579</link>
		<dc:creator><![CDATA[Ruk]]></dc:creator>
		<pubDate>Wed, 25 Apr 2012 19:07:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-279579</guid>
		<description><![CDATA[I am using the exact same way to display date only but it shows in our application dashboard with full DateTime stamp in data grid..

i typed in SQL server 2005, 
SELECT  CONVERT(VARCHAR(10),GETDATE(),101) as Date 

Any idea????]]></description>
		<content:encoded><![CDATA[<p>I am using the exact same way to display date only but it shows in our application dashboard with full DateTime stamp in data grid..</p>
<p>i typed in SQL server 2005,<br />
SELECT  CONVERT(VARCHAR(10),GETDATE(),101) as Date </p>
<p>Any idea????</p>
]]></content:encoded>
	</item>
</channel>
</rss>
