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)
 date format

Author  Topic 

collie
Constraint Violating Yak Guru

400 Posts

Posted - 2007-10-11 : 04:13:59
Hi,

I need to show a date in the format 11 Oct 2007. I tried using 106 but I get the date as 11 Oct 200. Any ideas why i don't get the full year?

Thanks

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-11 : 04:17:43
CONVERT(VARCHAR(11), Col1, 106)


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-11 : 04:18:30
quote:
Originally posted by collie

Hi,

I need to show a date in the format 11 Oct 2007. I tried using 106 but I get the date as 11 Oct 200. Any ideas why i don't get the full year?

Thanks

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.



select convert(varchar(12),getdate(),106)

Post the query you used

Also, if you want to show data in front end then just return datetime and format the date using format function there


Madhivanan

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

- Advertisement -