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 2000 Forums
 Transact-SQL (2000)
 Custom date Formating

Author  Topic 

ismail_issac
Starting Member

22 Posts

Posted - 2005-10-13 : 02:47:04
How to obtain Custom date formating using SQL

i want to convert date '2005/03/30'
to March 30, 2005

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2005-10-13 : 03:04:01
Try this ..

Declare @tmpDate SmallDatETime
Set @TmpDate = '2005/03/30'
Select DateName(Month,Convert (Varchar,@TmpDate,100)) + ' '+ DateName(Day,Convert (Varchar,@TmpDate,100)) + + ','+
DateName(Year,Convert (Varchar,@TmpDate,100))

i hope this helps you...

But most of the things is better if you do at the front end.

Complicated things can be done by simple thinking
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-10-13 : 03:16:40
quote:
Originally posted by ismail_issac

How to obtain Custom date formating using SQL

i want to convert date '2005/03/30'
to March 30, 2005




Where do you want to show these formated Date?
Are you using any Front End Application or Reports?

Madhivanan

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

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2005-10-14 : 00:55:49
select convert(varchar(50), [YourDate], 107)
Go to Top of Page
   

- Advertisement -