<?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>Mon, 13 Feb 2012 15:11:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Lots of Date Functions &#8211; Find Right One to Use &#8211; Quiz &#8211; Puzzle &#8211; 27 of 31 &#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-244737</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Lots of Date Functions &#8211; Find Right One to Use &#8211; Quiz &#8211; Puzzle &#8211; 27 of 31 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 28 Jan 2012 01:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-244737</guid>
		<description><![CDATA[[...] Difference Between DATETIME and DATETIME2 Difference Between GETDATE and SYSDATETIME Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime Datetime Function TODATETIMEOFFSET Example Information Related to DATETIME and DATETIME2 Datetime [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Difference Between DATETIME and DATETIME2 Difference Between GETDATE and SYSDATETIME Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime Datetime Function TODATETIMEOFFSET Example Information Related to DATETIME and DATETIME2 Datetime [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shiv shanker</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-231636</link>
		<dc:creator><![CDATA[shiv shanker]]></dc:creator>
		<pubDate>Thu, 05 Jan 2012 04:32:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-231636</guid>
		<description><![CDATA[but i got the same result 

using the query like this

Where checkinDate&gt;=&#039;12/12/2011&#039; And checkoutDate,=&#039;12/31/2012&#039;]]></description>
		<content:encoded><![CDATA[<p>but i got the same result </p>
<p>using the query like this</p>
<p>Where checkinDate&gt;=&#8217;12/12/2011&#8242; And checkoutDate,=&#8217;12/31/2012&#8242;</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-231091</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 08:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-231091</guid>
		<description><![CDATA[You need to convert these two varchars into datetime before doing any comparison]]></description>
		<content:encoded><![CDATA[<p>You need to convert these two varchars into datetime before doing any comparison</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shiv shanker</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-230493</link>
		<dc:creator><![CDATA[shiv shanker]]></dc:creator>
		<pubDate>Tue, 03 Jan 2012 06:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-230493</guid>
		<description><![CDATA[Hi all

I have       checkin date as varchar(10)
as well as checkout date as varchar(10)

and i have got all the record in the table between this dates including this date field

so what i do]]></description>
		<content:encoded><![CDATA[<p>Hi all</p>
<p>I have       checkin date as varchar(10)<br />
as well as checkout date as varchar(10)</p>
<p>and i have got all the record in the table between this dates including this date field</p>
<p>so what i do</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-219237</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 16 Dec 2011 07:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-219237</guid>
		<description><![CDATA[It is not possible. The implicit convertion happens. Why do you want to do this?]]></description>
		<content:encoded><![CDATA[<p>It is not possible. The implicit convertion happens. Why do you want to do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rakesh</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-211282</link>
		<dc:creator><![CDATA[Rakesh]]></dc:creator>
		<pubDate>Mon, 05 Dec 2011 12:16:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-211282</guid>
		<description><![CDATA[Select Convert(varchar(10),getdate(),101)
union all
select GETDATE()

result :
2011-12-05 00:00:00.000
2011-12-05 07:08:38.853

Required :
2011-12-05
2011-12-05 07:08:38.853

Can you please help me to solve the problem.]]></description>
		<content:encoded><![CDATA[<p>Select Convert(varchar(10),getdate(),101)<br />
union all<br />
select GETDATE()</p>
<p>result :<br />
2011-12-05 00:00:00.000<br />
2011-12-05 07:08:38.853</p>
<p>Required :<br />
2011-12-05<br />
2011-12-05 07:08:38.853</p>
<p>Can you please help me to solve the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sameer Khan</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-204183</link>
		<dc:creator><![CDATA[Sameer Khan]]></dc:creator>
		<pubDate>Fri, 25 Nov 2011 07:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-204183</guid>
		<description><![CDATA[I want to get the Date and the hour part.
To get the date i use select convert(varchar(10),getdate(),111) which gives me
2011/11/25 as Output.
But i want the hour part as well something like this:
2011/11/25 11 AM
Here 11 Am is the Hour part.How cn i achieve this?]]></description>
		<content:encoded><![CDATA[<p>I want to get the Date and the hour part.<br />
To get the date i use select convert(varchar(10),getdate(),111) which gives me<br />
2011/11/25 as Output.<br />
But i want the hour part as well something like this:<br />
2011/11/25 11 AM<br />
Here 11 Am is the Hour part.How cn i achieve this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developpeur</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-178814</link>
		<dc:creator><![CDATA[developpeur]]></dc:creator>
		<pubDate>Fri, 14 Oct 2011 12:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-178814</guid>
		<description><![CDATA[It&#039;s work. 
Thanks you very much.]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s work.<br />
Thanks you very much.</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-178355</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Thu, 13 Oct 2011 11:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-178355</guid>
		<description><![CDATA[You can easily do this

SELECT convert(varchar(5),getdate(),108) as t]]></description>
		<content:encoded><![CDATA[<p>You can easily do this</p>
<p>SELECT convert(varchar(5),getdate(),108) as t</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developpeur</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-178279</link>
		<dc:creator><![CDATA[developpeur]]></dc:creator>
		<pubDate>Thu, 13 Oct 2011 07:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-178279</guid>
		<description><![CDATA[This way is good for Hour.
SELECT
CAST( 
CASE WHEN LEN(DATEPART(hh,getdate())) = 1 
THEN &#039;0&#039; + CAST( DATEPART(hh,getdate()) AS varchar)
ELSE CAST( DATEPART(hh,getdate())AS varchar) END
AS varchar)

But it isn&#039;t smart]]></description>
		<content:encoded><![CDATA[<p>This way is good for Hour.<br />
SELECT<br />
CAST(<br />
CASE WHEN LEN(DATEPART(hh,getdate())) = 1<br />
THEN &#8217;0&#8242; + CAST( DATEPART(hh,getdate()) AS varchar)<br />
ELSE CAST( DATEPART(hh,getdate())AS varchar) END<br />
AS varchar)</p>
<p>But it isn&#8217;t smart</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developpeur</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-178276</link>
		<dc:creator><![CDATA[developpeur]]></dc:creator>
		<pubDate>Thu, 13 Oct 2011 07:15:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-178276</guid>
		<description><![CDATA[Thanks you but it s a wrong way.
I try 
SELECT (convert(varchar,DATEPART(hh,getdate())) + &#039;:&#039; + convert(varchar,DATEPART(N,getdate()),108)) as t
but i obtained 
9:2
I need 09:02]]></description>
		<content:encoded><![CDATA[<p>Thanks you but it s a wrong way.<br />
I try<br />
SELECT (convert(varchar,DATEPART(hh,getdate())) + &#8216;:&#8217; + convert(varchar,DATEPART(N,getdate()),108)) as t<br />
but i obtained<br />
9:2<br />
I need 09:02</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-178005</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 12 Oct 2011 15:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-178005</guid>
		<description><![CDATA[Use convert function with style 108. It will append it automatically]]></description>
		<content:encoded><![CDATA[<p>Use convert function with style 108. It will append it automatically</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-178000</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 12 Oct 2011 15:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-178000</guid>
		<description><![CDATA[where datecol&gt;&#039;20110901 22:00:00&#039; and date_col&lt;&#039;20111001 06:00:00&#039;]]></description>
		<content:encoded><![CDATA[<p>where datecol&gt;&#8217;20110901 22:00:00&#8242; and date_col&lt;&#039;20111001 06:00:00&#039;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azul</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-177669</link>
		<dc:creator><![CDATA[Azul]]></dc:creator>
		<pubDate>Tue, 11 Oct 2011 21:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-177669</guid>
		<description><![CDATA[Hello friends
 I have a case
 Where do I get a month records from a table and the condition is that the hours are from 22 pm to 6 am the following day,
 so far I have this.
 DATEPART (hh, date)  = 22 and date&gt; = &#039;20110901 &#039;and date &lt;&#039;20111001&#039;

 But I have no results, can you please help with syntax,]]></description>
		<content:encoded><![CDATA[<p>Hello friends<br />
 I have a case<br />
 Where do I get a month records from a table and the condition is that the hours are from 22 pm to 6 am the following day,<br />
 so far I have this.<br />
 DATEPART (hh, date)  = 22 and date&gt; = &#8217;20110901 &#8216;and date &lt;&#039;20111001&#039;</p>
<p> But I have no results, can you please help with syntax,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azul</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-177666</link>
		<dc:creator><![CDATA[Azul]]></dc:creator>
		<pubDate>Tue, 11 Oct 2011 21:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-177666</guid>
		<description><![CDATA[Hello friends
 I have a case
 Where do I get a month records from a table and the condition is that q is the time 22 pm to 6 am the following day,
 so far I have this.
 DATEPART (hh, date)  = 22 and date&gt; = &#039;20110901 &#039;and date &lt;&#039;20111001&#039;

 But I have no results, can you please help with syntax,]]></description>
		<content:encoded><![CDATA[<p>Hello friends<br />
 I have a case<br />
 Where do I get a month records from a table and the condition is that q is the time 22 pm to 6 am the following day,<br />
 so far I have this.<br />
 DATEPART (hh, date)  = 22 and date&gt; = &#8217;20110901 &#8216;and date &lt;&#039;20111001&#039;</p>
<p> But I have no results, can you please help with syntax,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developpeur</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-177533</link>
		<dc:creator><![CDATA[developpeur]]></dc:creator>
		<pubDate>Tue, 11 Oct 2011 13:11:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-177533</guid>
		<description><![CDATA[Do you know how add 0 before hour?
For example 1;30 -&gt; 01:30
and the same thing with minute?

thanks]]></description>
		<content:encoded><![CDATA[<p>Do you know how add 0 before hour?<br />
For example 1;30 -&gt; 01:30<br />
and the same thing with minute?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: developpeur</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-177526</link>
		<dc:creator><![CDATA[developpeur]]></dc:creator>
		<pubDate>Tue, 11 Oct 2011 12:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-177526</guid>
		<description><![CDATA[yes
this formul select convert(varchar,DATEPART(hh,getdate())) + &#039;:&#039; + convert(varchar,DATEPART(N,getdate())) is what i seach since 1 hour.

Thanks very much.]]></description>
		<content:encoded><![CDATA[<p>yes<br />
this formul select convert(varchar,DATEPART(hh,getdate())) + &#8216;:&#8217; + convert(varchar,DATEPART(N,getdate())) is what i seach since 1 hour.</p>
<p>Thanks very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi</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-162596</link>
		<dc:creator><![CDATA[Ravi]]></dc:creator>
		<pubDate>Sat, 27 Aug 2011 10:25:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-162596</guid>
		<description><![CDATA[Try this 

select Convert(varchar(5),getdate(),114)]]></description>
		<content:encoded><![CDATA[<p>Try this </p>
<p>select Convert(varchar(5),getdate(),114)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phani</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-157756</link>
		<dc:creator><![CDATA[Phani]]></dc:creator>
		<pubDate>Tue, 16 Aug 2011 10:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-157756</guid>
		<description><![CDATA[select convert(varchar,DATEPART(hh,getdate())-12) + &#039; : &#039; + convert(varchar,DATEPART(N,getdate())) +&#039; &#039;+ RIGHT(CONVERT(VARCHAR,GETDATE(),109),2)]]></description>
		<content:encoded><![CDATA[<p>select convert(varchar,DATEPART(hh,getdate())-12) + &#8216; : &#8216; + convert(varchar,DATEPART(N,getdate())) +&#8217; &#8216;+ RIGHT(CONVERT(VARCHAR,GETDATE(),109),2)</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-154091</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 05 Aug 2011 10:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-154091</guid>
		<description><![CDATA[SELECT DATEPART(HOUR,GETDATE()),DATEPART(MINUTE,GETDATE())]]></description>
		<content:encoded><![CDATA[<p>SELECT DATEPART(HOUR,GETDATE()),DATEPART(MINUTE,GETDATE())</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</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-153982</link>
		<dc:creator><![CDATA[kevin]]></dc:creator>
		<pubDate>Fri, 05 Aug 2011 05:25:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-153982</guid>
		<description><![CDATA[Hello Sir.
I want to know that how to get only Hour &amp; minute from Datetime field.
I have to make one Window service so that i need to check Hour and minute from database.
please help me in this]]></description>
		<content:encoded><![CDATA[<p>Hello Sir.<br />
I want to know that how to get only Hour &amp; minute from Datetime field.<br />
I have to make one Window service so that i need to check Hour and minute from database.<br />
please help me in this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivasu</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-153186</link>
		<dc:creator><![CDATA[srivasu]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 14:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-153186</guid>
		<description><![CDATA[Hi madhivanan

This is my query   output is 
 08:16:00
YOU ARE SPENDING IN OFFICE : 08:16:00 HOURS
YOU WILL GET LOSS OF PAY
Wait For Rest of Time:


I want to display   Rest of Time]]></description>
		<content:encoded><![CDATA[<p>Hi madhivanan</p>
<p>This is my query   output is<br />
 08:16:00<br />
YOU ARE SPENDING IN OFFICE : 08:16:00 HOURS<br />
YOU WILL GET LOSS OF PAY<br />
Wait For Rest of Time:</p>
<p>I want to display   Rest of Time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivasu</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-153185</link>
		<dc:creator><![CDATA[srivasu]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 14:19:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-153185</guid>
		<description><![CDATA[DECLARE @Logintime VARCHAR(36)  
          set   @Logintime=&#039;11:35am&#039;       
          DECLARE @Logouttime VARCHAR(10)           
          DECLARE @diff VARCHAR(36),    
                        
                  @hr   VARCHAR(30),           
                  @min  VARCHAR(2),           
                  @sec  VARCHAR(30),  
                  @resttime varchar(36)     
          ,@rtime  VARCHAR(30)                   
          DECLARE @NewLineChar AS CHAR(2)           
          SET @NewLineChar= CHAR(13) + CHAR(10)                           
          SET @Logouttime = (SELECT right(Getdate(), 8)AS t)        
          SET @sec = Abs(Datediff(SECOND, @Logintime, @Logouttime))               
          SET @hr = @sec / 3600  
          SET @min = ( @sec - ( @hr * 3600 ) ) / 60           
          SET @sec = ( @sec - ( @hr * 3600 ) - ( @min * 60 ) )     
       
          IF CAST(@hr AS INT) &lt; 10           
            SET @hr = &#039;0&#039; + @hr           
          
          IF CAST(@min AS INT) &lt; 10           
            SET @min = &#039;0&#039; + @min           
          
          IF CAST(@sec AS INT) &lt; 10           
            SET @sec = &#039;0&#039; + @sec           
          
          SET @diff = @hr + &#039;:&#039; + @min + &#039;:&#039; + @sec       
         print @diff     
        
    
          PRINT &#039;YOU ARE SPENDING IN OFFICE :&#039;+&#039; &#039; + @diff + &#039; &#039; + &#039;HOURS&#039;           
          
          IF CAST(@hr AS INT) &lt; 9       
          print &#039;YOU WILL GET LOSS OF PAY&#039; 
                            
          ELSE           
            PRINT &#039;SUCCESSFULLY CONSIDERED  YOUR ATTENDENCE FOR THIS DAY  &#039;]]></description>
		<content:encoded><![CDATA[<p>DECLARE @Logintime VARCHAR(36)<br />
          set   @Logintime=&#8217;11:35am&#8217;<br />
          DECLARE @Logouttime VARCHAR(10)<br />
          DECLARE @diff VARCHAR(36),    </p>
<p>                  @hr   VARCHAR(30),<br />
                  @min  VARCHAR(2),<br />
                  @sec  VARCHAR(30),<br />
                  @resttime varchar(36)<br />
          ,@rtime  VARCHAR(30)<br />
          DECLARE @NewLineChar AS CHAR(2)<br />
          SET @NewLineChar= CHAR(13) + CHAR(10)<br />
          SET @Logouttime = (SELECT right(Getdate(), 8)AS t)<br />
          SET @sec = Abs(Datediff(SECOND, @Logintime, @Logouttime))<br />
          SET @hr = @sec / 3600<br />
          SET @min = ( @sec &#8211; ( @hr * 3600 ) ) / 60<br />
          SET @sec = ( @sec &#8211; ( @hr * 3600 ) &#8211; ( @min * 60 ) )     </p>
<p>          IF CAST(@hr AS INT) &lt; 10<br />
            SET @hr = &#039;0&#039; + @hr           </p>
<p>          IF CAST(@min AS INT) &lt; 10<br />
            SET @min = &#039;0&#039; + @min           </p>
<p>          IF CAST(@sec AS INT) &lt; 10<br />
            SET @sec = &#039;0&#039; + @sec           </p>
<p>          SET @diff = @hr + &#039;:&#039; + @min + &#039;:&#039; + @sec<br />
         print @diff     </p>
<p>          PRINT &#039;YOU ARE SPENDING IN OFFICE :&#039;+&#039; &#039; + @diff + &#039; &#039; + &#039;HOURS&#039;           </p>
<p>          IF CAST(@hr AS INT) &lt; 9<br />
          print &#039;YOU WILL GET LOSS OF PAY&#039; </p>
<p>          ELSE<br />
            PRINT &#039;SUCCESSFULLY CONSIDERED  YOUR ATTENDENCE FOR THIS DAY  &#039;</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-153122</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 11:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-153122</guid>
		<description><![CDATA[Post some sample data and expected result]]></description>
		<content:encoded><![CDATA[<p>Post some sample data and expected result</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srivasu</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-153067</link>
		<dc:creator><![CDATA[srivasu]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 08:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5940#comment-153067</guid>
		<description><![CDATA[Hi Pinal,

Plz help me]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Plz help me</p>
]]></content:encoded>
	</item>
</channel>
</rss>

