<?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 Date Time in Any Format &#8211; UDF &#8211; User Defined Functions</title>
	<atom:link href="http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 10 Feb 2012 02:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Shaik Nazeer Hussain</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-234003</link>
		<dc:creator><![CDATA[Shaik Nazeer Hussain]]></dc:creator>
		<pubDate>Mon, 09 Jan 2012 06:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-234003</guid>
		<description><![CDATA[Hi,

I have date format like this 
select [dbo].[ufsFormat]
 (&#039;09-Jan-2012  3:15:58 PM&#039;, &#039;dd-Mmm-YYYY hh:MM:SS AM/PM&#039;) and i am getting the result 09-Jan-2012  3:15:58 PM.

But i need output is like(have to add zero in my hours when it is in 12 hours format) 09-Jan-2012  03:15:58 PM.

I am using Sqlserver2005.
Can any one help me out.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have date format like this<br />
select [dbo].[ufsFormat]<br />
 (&#8217;09-Jan-2012  3:15:58 PM&#8217;, &#8216;dd-Mmm-YYYY hh:MM:SS AM/PM&#8217;) and i am getting the result 09-Jan-2012  3:15:58 PM.</p>
<p>But i need output is like(have to add zero in my hours when it is in 12 hours format) 09-Jan-2012  03:15:58 PM.</p>
<p>I am using Sqlserver2005.<br />
Can any one help me out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronak Shah</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-207897</link>
		<dc:creator><![CDATA[Ronak Shah]]></dc:creator>
		<pubDate>Wed, 30 Nov 2011 10:25:30 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-207897</guid>
		<description><![CDATA[how to display in DD - MMM - yyyy where dash are compulsory . Not DD MMM YYYY]]></description>
		<content:encoded><![CDATA[<p>how to display in DD &#8211; MMM &#8211; yyyy where dash are compulsory . Not DD MMM YYYY</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: poonam</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-173538</link>
		<dc:creator><![CDATA[poonam]]></dc:creator>
		<pubDate>Fri, 30 Sep 2011 11:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-173538</guid>
		<description><![CDATA[need a format  DD/MM/YYYY HH:MI:SS how could i perform it]]></description>
		<content:encoded><![CDATA[<p>need a format  DD/MM/YYYY HH:MI:SS how could i perform it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-123340</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 15 Mar 2011 14:59:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-123340</guid>
		<description><![CDATA[What is the datatype of @dtGetDate?]]></description>
		<content:encoded><![CDATA[<p>What is the datatype of @dtGetDate?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naren</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-123322</link>
		<dc:creator><![CDATA[Naren]]></dc:creator>
		<pubDate>Tue, 15 Mar 2011 11:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-123322</guid>
		<description><![CDATA[CONVERT(CHAR(24), @dtGetDate, 103), converts format of @dtGetDate to 103.
Can there be a way to know in which format @dtGetDate is?]]></description>
		<content:encoded><![CDATA[<p>CONVERT(CHAR(24), @dtGetDate, 103), converts format of @dtGetDate to 103.<br />
Can there be a way to know in which format @dtGetDate is?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biju K S</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-115861</link>
		<dc:creator><![CDATA[Biju K S]]></dc:creator>
		<pubDate>Thu, 03 Feb 2011 13:05:17 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-115861</guid>
		<description><![CDATA[Thanks for your reply Madhivanan,
The following code also will return the same result,
Here i have used CTE,
please check the code.

declare @varstartdate datetime
declare @varenddate datetime
declare @vardiff int

set @varstartdate = &#039;01/18/2011&#039;
set @varenddate = &#039;01/25/2011&#039;

set @vardiff = DATEDIFF(d,@varstartdate,@varenddate)

declare @s varchar(max)
set @s=&#039;with numbers as
(
select 1 as Num, convert(datetime,&#039;&#039;&#039; + convert(varchar,@varstartdate,101) + &#039;&#039;&#039;)   as vardate1
union all
select Num + 1, convert(datetime,&#039;&#039;&#039; + convert(varchar,@varstartdate,101) + &#039;&#039;&#039;) + Num from numbers where Num &lt; &#039; + convert(varchar,@vardiff) + &#039;
)
select convert(varchar,vardate1,101) from numbers option(Maxrecursion 25)&#039;
execute (@s)]]></description>
		<content:encoded><![CDATA[<p>Thanks for your reply Madhivanan,<br />
The following code also will return the same result,<br />
Here i have used CTE,<br />
please check the code.</p>
<p>declare @varstartdate datetime<br />
declare @varenddate datetime<br />
declare @vardiff int</p>
<p>set @varstartdate = &#8217;01/18/2011&#8242;<br />
set @varenddate = &#8217;01/25/2011&#8242;</p>
<p>set @vardiff = DATEDIFF(d,@varstartdate,@varenddate)</p>
<p>declare @s varchar(max)<br />
set @s=&#8217;with numbers as<br />
(<br />
select 1 as Num, convert(datetime,&#8221;&#8217; + convert(varchar,@varstartdate,101) + &#8221;&#8217;)   as vardate1<br />
union all<br />
select Num + 1, convert(datetime,&#8221;&#8217; + convert(varchar,@varstartdate,101) + &#8221;&#8217;) + Num from numbers where Num &lt; &#039; + convert(varchar,@vardiff) + &#039;<br />
)<br />
select convert(varchar,vardate1,101) from numbers option(Maxrecursion 25)&#039;<br />
execute (@s)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-114043</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 25 Jan 2011 08:51:33 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-114043</guid>
		<description><![CDATA[select dateadd(day,number,cast(&#039;20110118&#039; as datetime)) from master..spt_values
where dateadd(day,number,cast(&#039;20110118&#039; as datetime))&lt;&#039;20110125&#039; and type=&#039;p&#039;]]></description>
		<content:encoded><![CDATA[<p>select dateadd(day,number,cast(&#8217;20110118&#8242; as datetime)) from master..spt_values<br />
where dateadd(day,number,cast(&#8217;20110118&#8242; as datetime))&lt;&#039;20110125&#039; and type=&#039;p&#039;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biju K S</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-113860</link>
		<dc:creator><![CDATA[Biju K S]]></dc:creator>
		<pubDate>Mon, 24 Jan 2011 15:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-113860</guid>
		<description><![CDATA[Hi All ,

Can any one answer how to get a series of dates with in a particular starting and ending date ?

For example my starting is &#039;01/18/2011&#039; and my ending date is &#039;01/25/2011&#039;, i need to get all the dates between those dates like,
Output: 
01/18/2011
01/19/2011
01/20/2011
01/21/2011
01/22/2011
01/23/2011
01/24/2011]]></description>
		<content:encoded><![CDATA[<p>Hi All ,</p>
<p>Can any one answer how to get a series of dates with in a particular starting and ending date ?</p>
<p>For example my starting is &#8217;01/18/2011&#8242; and my ending date is &#8217;01/25/2011&#8242;, i need to get all the dates between those dates like,<br />
Output:<br />
01/18/2011<br />
01/19/2011<br />
01/20/2011<br />
01/21/2011<br />
01/22/2011<br />
01/23/2011<br />
01/24/2011</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raj</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-102732</link>
		<dc:creator><![CDATA[Raj]]></dc:creator>
		<pubDate>Mon, 29 Nov 2010 06:21:10 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-102732</guid>
		<description><![CDATA[Hi my clients need to display date time in following format.

dd/mm/yy hh:mm:ss

Like 
29/11/20 11:49:30

Not AM or PM

Day/Months/year(only last two digit) time in 24 Hour format.

How can I do this.

I am using SQL Server 2008 ans asp.net 3.5.

Please help me.

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi my clients need to display date time in following format.</p>
<p>dd/mm/yy hh:mm:ss</p>
<p>Like<br />
29/11/20 11:49:30</p>
<p>Not AM or PM</p>
<p>Day/Months/year(only last two digit) time in 24 Hour format.</p>
<p>How can I do this.</p>
<p>I am using SQL Server 2008 ans asp.net 3.5.</p>
<p>Please help me.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umar</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-75171</link>
		<dc:creator><![CDATA[Umar]]></dc:creator>
		<pubDate>Tue, 08 Jun 2010 11:09:46 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-75171</guid>
		<description><![CDATA[Hello pinal dev sir
can we convert current date like following formate
if date is 08/06/2010 then i want to convert like

8th June 2010

if my date is 21/06/2010 then i want
21st June 2010


please tell me

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hello pinal dev sir<br />
can we convert current date like following formate<br />
if date is 08/06/2010 then i want to convert like</p>
<p>8th June 2010</p>
<p>if my date is 21/06/2010 then i want<br />
21st June 2010</p>
<p>please tell me</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajni</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-67077</link>
		<dc:creator><![CDATA[Rajni]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 06:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-67077</guid>
		<description><![CDATA[heY bOSS U R GENIOUS]]></description>
		<content:encoded><![CDATA[<p>heY bOSS U R GENIOUS</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kishi</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-67064</link>
		<dc:creator><![CDATA[kishi]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 05:36:40 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-67064</guid>
		<description><![CDATA[this is the respnse of the parent form.]]></description>
		<content:encoded><![CDATA[<p>this is the respnse of the parent form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VIPIN</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-67055</link>
		<dc:creator><![CDATA[VIPIN]]></dc:creator>
		<pubDate>Tue, 27 Apr 2010 04:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-67055</guid>
		<description><![CDATA[hey,,this needs to be checked out]]></description>
		<content:encoded><![CDATA[<p>hey,,this needs to be checked out</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankit</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-61012</link>
		<dc:creator><![CDATA[Ankit]]></dc:creator>
		<pubDate>Thu, 11 Feb 2010 10:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-61012</guid>
		<description><![CDATA[Hi, Madhivanan
Sorry for delay reply.
Actually I found solution, reference link given by Tejas Shah. thnx Tejas and you also.]]></description>
		<content:encoded><![CDATA[<p>Hi, Madhivanan<br />
Sorry for delay reply.<br />
Actually I found solution, reference link given by Tejas Shah. thnx Tejas and you also.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-61005</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Thu, 11 Feb 2010 08:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-61005</guid>
		<description><![CDATA[declare @from datetime ,@to datetime
select @from=&#039;2009-11-01&#039;,@to=&#039;2009-12-02&#039;
select 
	dateadd(day,number,@from) as dates
from master..spt_values
where type=&#039;p&#039; and number between 0 and datediff(day,@from,@to)]]></description>
		<content:encoded><![CDATA[<p>declare @from datetime ,@to datetime<br />
select @from=&#8217;2009-11-01&#8242;,@to=&#8217;2009-12-02&#8242;<br />
select<br />
	dateadd(day,number,@from) as dates<br />
from master..spt_values<br />
where type=&#8217;p&#8217; and number between 0 and datediff(day,@from,@to)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-60718</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Fri, 05 Feb 2010 13:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-60718</guid>
		<description><![CDATA[Do the formation at .NET
What is the difficulty you are having there?]]></description>
		<content:encoded><![CDATA[<p>Do the formation at .NET<br />
What is the difficulty you are having there?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Babu</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-59474</link>
		<dc:creator><![CDATA[Babu]]></dc:creator>
		<pubDate>Fri, 08 Jan 2010 12:36:03 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-59474</guid>
		<description><![CDATA[hi dave ,
              diz babu .i am new to diz blog,i have doubt that,
 how to generate the dates in between given dates in sql,
ex :i have date&#039;s 1/11/09 &amp; 2/12/09.if i want to display the dates in between these two .how can i move.
                           waiting for the reply.plz kindly give me an idea as early as possible.]]></description>
		<content:encoded><![CDATA[<p>hi dave ,<br />
              diz babu .i am new to diz blog,i have doubt that,<br />
 how to generate the dates in between given dates in sql,<br />
ex :i have date&#8217;s 1/11/09 &amp; 2/12/09.if i want to display the dates in between these two .how can i move.<br />
                           waiting for the reply.plz kindly give me an idea as early as possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejas Shah</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-57590</link>
		<dc:creator><![CDATA[Tejas Shah]]></dc:creator>
		<pubDate>Fri, 13 Nov 2009 09:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-57590</guid>
		<description><![CDATA[Hi Ankit,

Please find attached link for the same:

h ttp://tejasnshah.wordpress.com/2008/12/22/sql-server-get-time-in-ampm-format/

Thanks,

Tejas]]></description>
		<content:encoded><![CDATA[<p>Hi Ankit,</p>
<p>Please find attached link for the same:</p>
<p>h ttp://tejasnshah.wordpress.com/2008/12/22/sql-server-get-time-in-ampm-format/</p>
<p>Thanks,</p>
<p>Tejas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankit</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-57487</link>
		<dc:creator><![CDATA[Ankit]]></dc:creator>
		<pubDate>Tue, 10 Nov 2009 11:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-57487</guid>
		<description><![CDATA[Hi Pinal,

I want following .Net DatTime Format dd/M/yyyy h:mm:ss tt in SQL Server 2005: 


I have date in SQL Server is: 2009-11-10 16:20:42.017
and I want result as: 10/11/2009 4:20:42 PM

Regards,
Ankit]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>I want following .Net DatTime Format dd/M/yyyy h:mm:ss tt in SQL Server 2005: </p>
<p>I have date in SQL Server is: 2009-11-10 16:20:42.017<br />
and I want result as: 10/11/2009 4:20:42 PM</p>
<p>Regards,<br />
Ankit</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-55417</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Mon, 31 Aug 2009 02:52:51 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-55417</guid>
		<description><![CDATA[@Mayur.

Above format is mm/dd/yy

I forgot you asked, this format : dd/mm/yyyy, to get this format, just replace, 101 by 103 in the above script. 

Script 1:
create table #Example1 ( Id int , Date Datetime )
insert into #Example1 values ( 1 , getdate())
select Id, convert (varchar, date, 103) from #Example1

Script 2:
Create table #Example2 ( Id int, Date varchar(11))
insert into #Example2 values ( 1 , convert (varchar(11),getdate(), 103))
select * from #Example2

drop table #Example1 , #Example2]]></description>
		<content:encoded><![CDATA[<p>@Mayur.</p>
<p>Above format is mm/dd/yy</p>
<p>I forgot you asked, this format : dd/mm/yyyy, to get this format, just replace, 101 by 103 in the above script. </p>
<p>Script 1:<br />
create table #Example1 ( Id int , Date Datetime )<br />
insert into #Example1 values ( 1 , getdate())<br />
select Id, convert (varchar, date, 103) from #Example1</p>
<p>Script 2:<br />
Create table #Example2 ( Id int, Date varchar(11))<br />
insert into #Example2 values ( 1 , convert (varchar(11),getdate(), 103))<br />
select * from #Example2</p>
<p>drop table #Example1 , #Example2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-55416</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Mon, 31 Aug 2009 02:49:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-55416</guid>
		<description><![CDATA[@Mayur, 

I have written two scripts, Execute them and check the results. 

Script 1:
create table #Example1 ( Id int , Date Datetime )
insert into #Example1 values ( 1 , getdate())
select Id, convert (varchar, date, 101)  from #Example1 

Script 2:
Create table #Example2 ( Id int, Date varchar(11))
insert into #Example2 values ( 1 , convert (varchar(11),getdate(), 101))
select * from #Example2 

drop table #Example1 , #Example2 

~IM.]]></description>
		<content:encoded><![CDATA[<p>@Mayur, </p>
<p>I have written two scripts, Execute them and check the results. </p>
<p>Script 1:<br />
create table #Example1 ( Id int , Date Datetime )<br />
insert into #Example1 values ( 1 , getdate())<br />
select Id, convert (varchar, date, 101)  from #Example1 </p>
<p>Script 2:<br />
Create table #Example2 ( Id int, Date varchar(11))<br />
insert into #Example2 values ( 1 , convert (varchar(11),getdate(), 101))<br />
select * from #Example2 </p>
<p>drop table #Example1 , #Example2 </p>
<p>~IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mayur dongre</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-55404</link>
		<dc:creator><![CDATA[mayur dongre]]></dc:creator>
		<pubDate>Sun, 30 Aug 2009 09:46:19 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-55404</guid>
		<description><![CDATA[i want to store date in sql server 2000 in &#039;dd/mm/yyyy&#039; formate can it is posible please tell me and give me the query how to write it.]]></description>
		<content:encoded><![CDATA[<p>i want to store date in sql server 2000 in &#8216;dd/mm/yyyy&#8217; formate can it is posible please tell me and give me the query how to write it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-54318</link>
		<dc:creator><![CDATA[Brian Tkatch]]></dc:creator>
		<pubDate>Fri, 31 Jul 2009 12:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-54318</guid>
		<description><![CDATA[@MJDA

It might help to see the actual SQL statement that causes the error.

Also, the conversion can be slightly easier than you posted. For minutes, i&#039;d do it slightly differently:

DECLARE @A INT
SET @A = 1650
SELECT CAST(@A / 100 AS VARCHAR(2)) + &#039;:&#039; + CAST (CAST(60 * ((@A % 100) / 100.0) AS INT) AS VARCHAR(2))]]></description>
		<content:encoded><![CDATA[<p>@MJDA</p>
<p>It might help to see the actual SQL statement that causes the error.</p>
<p>Also, the conversion can be slightly easier than you posted. For minutes, i&#8217;d do it slightly differently:</p>
<p>DECLARE @A INT<br />
SET @A = 1650<br />
SELECT CAST(@A / 100 AS VARCHAR(2)) + &#8216;:&#8217; + CAST (CAST(60 * ((@A % 100) / 100.0) AS INT) AS VARCHAR(2))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MJDA</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-54302</link>
		<dc:creator><![CDATA[MJDA]]></dc:creator>
		<pubDate>Fri, 31 Jul 2009 07:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-54302</guid>
		<description><![CDATA[Pinal,

Happy birthday.

I have a table that has an integer field that records time taken as a whole number(don’t ask). For example 1650 = 16:30, or 35 = 00:21. Once the data is summed I want to be able to convert to a hh:mm format.

I have drafted this SQL but get error “Syntax error converting the varchar value &#039;0:0&#039; to a column of data type int.”

DECLARE @SQL_HOLDER nvarchar(3000)
SET @SQL_HOLDER = &#039;
declare @hoursall int 
declare @hours decimal(18,2)
UPDATE visits
set 	@hoursall = travel_time,
	@hours = @hoursall/100,
	travel_time = convert(varchar, convert(int, @hours)) + &#039;&#039;:&#039;&#039; + convert(varchar, convert(int, 60 * (@hours - convert(int, @hours)))) &#039;
EXEC sp_executesql @SQL_HOLDER
GO

Michael]]></description>
		<content:encoded><![CDATA[<p>Pinal,</p>
<p>Happy birthday.</p>
<p>I have a table that has an integer field that records time taken as a whole number(don’t ask). For example 1650 = 16:30, or 35 = 00:21. Once the data is summed I want to be able to convert to a hh:mm format.</p>
<p>I have drafted this SQL but get error “Syntax error converting the varchar value &#8217;0:0&#8242; to a column of data type int.”</p>
<p>DECLARE @SQL_HOLDER nvarchar(3000)<br />
SET @SQL_HOLDER = &#8216;<br />
declare @hoursall int<br />
declare @hours decimal(18,2)<br />
UPDATE visits<br />
set 	@hoursall = travel_time,<br />
	@hours = @hoursall/100,<br />
	travel_time = convert(varchar, convert(int, @hours)) + &#8221;:&#8221; + convert(varchar, convert(int, 60 * (@hours &#8211; convert(int, @hours)))) &#8216;<br />
EXEC sp_executesql @SQL_HOLDER<br />
GO</p>
<p>Michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sivadutta</title>
		<link>http://blog.sqlauthority.com/2008/08/14/sql-server-get-date-time-in-any-format-udf-user-defined-functions/#comment-53955</link>
		<dc:creator><![CDATA[Sivadutta]]></dc:creator>
		<pubDate>Wed, 22 Jul 2009 11:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=820#comment-53955</guid>
		<description><![CDATA[Hi Pinal,

 I have a situation in one of my project requirement.
I want date format like &quot; ,  &quot;.
Is it possible in sql 2005?
I hope I will find it out asap.Please help me out.


Regards,

Siva]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p> I have a situation in one of my project requirement.<br />
I want date format like &#8221; ,  &#8220;.<br />
Is it possible in sql 2005?<br />
I hope I will find it out asap.Please help me out.</p>
<p>Regards,</p>
<p>Siva</p>
]]></content:encoded>
	</item>
</channel>
</rss>

