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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 format datetime

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-11-01 : 09:23:49
Hello,
I have a script that selects date from a db,

how do i format it as November 1, 2008 10:00 am ?
thanks

_____________________


Yes O !

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-01 : 09:46:47
quote:
Originally posted by mary_itohan

Hello,
I have a script that selects date from a db,

how do i format it as November 1, 2008 10:00 am ?
thanks

_____________________


Yes O !


Where do you want to show formatted dates?

Madhivanan

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

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-11-01 : 10:08:16
in my sql statement or .net page

Either, I need assistance

_____________________


Yes O !
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-01 : 10:24:29
quote:
Originally posted by mary_itohan

in my sql statement or .net page

Either, I need assistance

_____________________


Yes O !


If you want to show in .NET page, better use format function there

something like

.Tostring("your format")

In query


select convert(varchar(30),getdate(),100)

Madhivanan

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

- Advertisement -