convert minutes to hours<p>hi,</p> <p>I want to convert minutes to hours. for example field_minutes=130minutes to 2:10 hours...</p> <p>select field_minutes from table---&gt; how can I do?</p> <p> </p>© 2009 Microsoft Corporation. All rights reserved.Fri, 12 Dec 2008 01:55:13 Z0726b6fb-c7ec-4ff3-930b-93c057c9639chttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/0726b6fb-c7ec-4ff3-930b-93c057c9639c#0726b6fb-c7ec-4ff3-930b-93c057c9639chttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/0726b6fb-c7ec-4ff3-930b-93c057c9639c#0726b6fb-c7ec-4ff3-930b-93c057c9639cesin gültenhttp://social.msdn.microsoft.com/Profile/en-US/?user=esin%20g%u00fcltenconvert minutes to hours<p>hi,</p> <p>I want to convert minutes to hours. for example field_minutes=130minutes to 2:10 hours...</p> <p>select field_minutes from table---&gt; how can I do?</p> <p> </p>Fri, 24 Feb 2006 15:26:44 Z2006-02-24T15:26:44Zhttp://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/0726b6fb-c7ec-4ff3-930b-93c057c9639c#76fce801-677f-4c65-bfd1-b33157c811c0http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/0726b6fb-c7ec-4ff3-930b-93c057c9639c#76fce801-677f-4c65-bfd1-b33157c811c0Jamie Thomsonhttp://social.msdn.microsoft.com/Profile/en-US/?user=Jamie%20Thomsonconvert minutes to hours<p>Not sure what this has got to do with SSIS but its an interesting little puzzle for a Friday afternoon anyway.</p> <p>Paste the following into SSMS/QA and run it:</p><font color="#0000ff" size=2><font color="#0000ff" size=2> <p>declare</font><font color="#000000" size=2> @mins </font><font color="#0000ff" size=2>int</p> <p>set</font><font color="#000000" size=2> @mins </font><font color="#808080" size=2>=</font><font size=2><font color="#000000"> 130</font></p></font><font color="#0000ff" size=2> <p>select</font><font color="#000000" size=2> </font><font color="#ff00ff" size=2>cast</font><font color="#808080" size=2>(</font><font color="#000000" size=2>@mins</font><font color="#808080" size=2>/</font><font color="#000000" size=2>60 </font><font color="#0000ff" size=2>as</font><font color="#000000" size=2> </font><font color="#0000ff" size=2>varchar</font><font color="#808080" size=2>(</font><font color="#000000" size=2>5</font><font color="#808080" size=2>))</font><font color="#000000" size=2> </font><font color="#808080" size=2>+</font><font color="#000000" size=2> </font><font color="#ff0000" size=2>':'</font><font color="#000000" size=2> </font><font color="#808080" size=2>+</font><font color="#000000" size=2> </font><font color="#808080" size=2>RIGHT(</font><font color="#ff0000" size=2>'0'</font><font color="#000000" size=2> </font><font color="#808080" size=2>+</font><font color="#000000" size=2> </font><font color="#ff00ff" size=2>cast</font><font color="#808080" size=2>(</font><font color="#000000" size=2>@mins</font><font color="#808080" size=2>%</font><font color="#000000" size=2>60 </font><font color="#0000ff" size=2>as</font><font color="#000000" size=2> </font><font color="#0000ff" size=2>varchar</font><font color="#808080" size=2>(</font><font color="#000000" size=2>2</font><font color="#808080" size=2>)),</font><font color="#000000" size=2> 2</font><font color="#808080" size=2>)</p> <p></font></font> <p><font color="#808080" size=2> </p></font>There are probably other, better, ways!!!</p> <p> </p> <p>-Jamie</p> <p> </p>Fri, 24 Feb 2006 15:42:57 Z2006-02-24T15:42:57Z