Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 DateTime Format?

Author  Topic 

raysefo
Constraint Violating Yak Guru

260 Posts

Posted - 2010-10-05 : 04:42:13
Hi,

I m getting DateTime from Db as follows;

CONVERT (varchar(20), CreationDate, 113)

And it brings me this :
04 Oct 2010 17:33:29

What i would like to have is,
04 10 2010 17:33:29

Best Regards

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-05 : 04:44:00
Have a look here for possibilities on convert()
http://msdn.microsoft.com/en-us/library/ms187928.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

raysefo
Constraint Violating Yak Guru

260 Posts

Posted - 2010-10-05 : 05:03:35
Thanks

CONVERT(CHAR(10),CreationDate,104) + SUBSTRING(CONVERT(varchar,CreationDate,0),12,8)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-10-05 : 06:05:10
quote:
Originally posted by raysefo

Hi,

I m getting DateTime from Db as follows;

CONVERT (varchar(20), CreationDate, 113)

And it brings me this :
04 Oct 2010 17:33:29

What i would like to have is,
04 10 2010 17:33:29

Best Regards


If you do front end application, do formation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -